How to auto focus on textfield in jetpack compose. When i click on textfield and start typing on it. Meantime when i click back button,then when i'm try to click on textfield, nothing happens.
val textState = remember { mutableStateOf(TextFieldValue()) }
TextField(
modifier = Modifier.fillMaxWidth(),
value = textState.value,
onValueChange = { value : TextFieldValue ->
textState.value = value
}
)
Taken from Compose Unit Tests and applied to TextField Link
Edit: Changed Box to Row because Box has been deprecated in '1.0.0-alpha04'