Daniele Segato
07/19/2021, 7:41 AMonValueChange
callback that is coming with a single character
@Composable
fun ReproduceBug() {
var value by remember { mutableStateOf(TextFieldValue()) }
Column {
Text(text = "Write on this textfield over 50 characters")
TextField(
value = value,
onValueChange = {
if (it.text.length <= 50) {
value = it
}
},
)
Text(text = "Characters: ${value.text.length}")
}
}
I've created a bug report https://issuetracker.google.com/issues/193896392