Text input is not working
Closed this issue · 1 comments
rzolin commented
Hey, I hope somebody could help me with the text input. I have started to play with this framework and I like it, but when I created a text field the input is not working, not on the virtual keyboard in the simulator or on the real device. I even checked it with the latest version of the demo app in the repo. Just added a text field in the details page and tried to enter text - nothing happening.
Something like this:
var text: String = ""
OutlinedTextField(
value = "",
onValueChange = { text = it },
label = { Text("Text") },
modifier = Modifier.fillMaxWidth()
By the way, I am on latest Iguana version of Android Studio and checked on these devices:
xxfast commented
Hi. Sorry, I don't see how this is an issue with the library.
The issue is that your text
has to be a mutable state like this
var text: String by remember { mutableStateOf("") }
OutlinedTextField(
value = text,
onValueChange = { text = it },
label = { Text("Text") },
modifier = Modifier.fillMaxWidth()
)
Read more on docs here