Archie
10/22/2024, 3:27 AM@Composable
fun SomeTextField(value: String, onChange: (String) -> Unit, ...) {
...
TextField(
value = value,
onValueChange = onChange,
...,
keyboardOptions = KeyboardOptions(
keyboardType = KeyboardType.NumberPassword,
imeAction = if (someState) ImeAction.Go else ImeAction.Done,
),
)
...
}
this line:
imeAction = if (someState) ImeAction.Go else ImeAction.Done,
causes the ios keyboard to hide and immediately show back up. I was wonder if doing so in compose is not advisable?Andy Dent
10/22/2024, 5:18 AMsomeState?
I’m still fairly new to CMP but if that was some kind of binding, I could see it causing grief with state changes. I really have no feel yet for which bits of CMP cause there to be active things that rebuild visual stuff.
I would do a quick test with a local val set to true and then to false and see if it’s the expression or the expression result changing that causes keyboard flickersArchie
10/22/2024, 5:22 AMsomeState, it could be a verification of the input (isValidEmail or isInputComplete) where if the input does not fit the validation, the ImeAction should show Done, but when it passes the validation it should show Go.Archie
10/22/2024, 5:23 AMAndy Dent
10/22/2024, 5:23 AMAndy Dent
10/22/2024, 5:23 AMArchie
10/22/2024, 5:25 AMsomeState is already local to the composable if thats what you meant.Andy Dent
10/22/2024, 5:26 AMArchie
10/22/2024, 5:27 AM