Eko Prasetyo
05/14/2022, 11:43 AMste
05/14/2022, 1:17 PMste
05/14/2022, 1:19 PMval focusManager = LocalFocusManager.current
var textInput by remember {
mutableStateOf("")
}
val focusRequester = remember {
FocusRequester()
}
BasicTextField(
value = textInput,
onValueChange = { textInput = it },
decorationBox = { innerTextField ->
Column {
innerTextField()
if (textInput == "lol") {
BasicText(text = "no, you can't do that")
LaunchedEffect(Unit) {
focusManager.clearFocus()
focusRequester.requestFocus()
}
}
}
},
modifier = Modifier
.focusRequester(focusRequester)
)
ste
05/14/2022, 1:26 PMdecorationBox
and the focus needs to be cleared and request againEko Prasetyo
05/14/2022, 2:04 PMtad
05/15/2022, 3:34 AMModifier.focusGroup
on a Composable containing both the text field and error textEko Prasetyo
05/15/2022, 6:36 AM