https://kotlinlang.org logo
#compose
Title
# compose
c

chanjungskim

03/24/2023, 3:55 AM
How can I limit the size of input of TextField? in XML I used
InputFilter
something like this:
Copy code
val limitSizeInputFilter = arrayOf<InputFilter>(ByteLengthFilter(100, "UTF-8"))

binding.nsetName.filters = limitSizeInputFilter
Is there any equivalent to it in compose?
c

Csaba Szugyiczki

03/24/2023, 8:44 AM
you can do any kind of filtering on the TextField by simply ignoring changes in the
onValueChange
callback if the new value does not meet your criteria
8 Views