I have a BasicTextField that using for phone number with VisualTransformation . I can format phone number with VisualTransformation like # ### ### ## ##. But how can I make a BasicTextField that hold first two characters (because in Turkey all of the mobile phone numbers start with 05) and make that caracters undeletable. In other words user can write last 8 characters own phone number. When I give default "05" to TextFieldValue , state value is overriding that default value.
Asked
Active
Viewed 434 times
1
-
https://stackoverflow.com/help/minimal-reproducible-example But you probably want to use onValueChange and add prefix – Милош Којадиновић Jun 26 '22 at 18:04
-
@Милош Којадиновић yes absolutely – emreturka Jun 26 '22 at 19:22
-
Something like https://stackoverflow.com/questions/67735208/how-to-prefix-country-code-in-textfield-using-jetpack-compose/67735317#67735317 – Gabriele Mariotti Jun 27 '22 at 07:37