Unrelated text input question: the kdoc for text f...
# compose
z
Unrelated text input question: the kdoc for text fields say that
onValueChanged
should not be used to change the value of the text field to anything other than what the IME sent. This implies it shouldn't be used to implement something like
InputFilter
for eg phone numbers. Is this a temporary limitation, or is there a plan to address this use case another way?
s
It can be changed but it will reset the ime connection. We added VisualFilter as an API for formatting. Feedback would be awesome :)
z
Oh, derp. For some reason I thought VisualTransformation could only do 1:1 character mapping.
s
That part is imho a little hard right now.
z
Could you use it to implement a filter, eg only allow certain characters to be typed?
s
I believe that requires changing the text.
z
Is the resetting the IME connection behavior the same thing that would happen with EditText right now?
s
Should be yes.
👍 1