I started adopting Compose 1.1.1 in an existing An...
# compose
f
I started adopting Compose 1.1.1 in an existing Android app but I'm facing very weird behavior when trying to limit input in a
TextField
to decimal numbers. I just posted a question on StackOverflow with the full details, but I could also post them here if you prefer. The TL;DR is that even if I do not update my state in response to the
onValueChange
callback (or if I just set the previous value and ignore the new one), the text I get in the next
onValueChange
still includes the changes I rejected.
r
Try using a regular string and not using the inner data class
f
I tried something like that, having either a
String
or a
TextFieldValue
as local remembered state in the composable and getting rid of the view model altogether, and encountered the same or similar results
b
I have a couple defects around this filed on the issue tracker. I think one has been fixed, and the other is still outstanding. Let me get a link …
hmm … supposedly this one is fixed too https://issuetracker.google.com/issues/200577798
f
awesome, I did a quick search in the issue tracker before posting here but did not find your issues. Thanks for the links!
b
The 2nd one had it’s fix committed on Jan 22 … So maybe it hasn’t made it into a release yet?
the first one was fixed on Feb 9, so maybe it also has not made it into a release yet
f
were you able to implement any workarounds? I've tried a few, but nothing that worked so far, so I'm basically unable to have a filtered text field in the app for now
r
I can send you an example of what I have a bit later - I have several text fields that do filtering
f
FWIW my issue is fixed in
1.2.0-alpha05