When I programmatically hide the keyboard which is focused on the TextField, it flickering. How to get rid of this?
val keyboardController = LocalSoftwareKeyboardController.current
var text by rememberSaveable { mutableStateOf("") }
TextField(
modifier = Modifier.fillMaxWidth(),
value = text,
keyboardOptions = KeyboardOptions(imeAction = ImeAction.Done),
keyboardActions = KeyboardActions(
onDone = {
keyboardController?.hide() // Causes flickering
}
),
onValueChange = {
text = it
}
)
I also noticed that sometimes flicker occurs when you open the previous screen. Is it possible to see somewhere what exactly causes the keyboard to open and close?
POCO X3 NFC, Android 12, MIUI Global 14.0.2
androidx.compose:compose-bom:2023.08.00