https://kotlinlang.org logo
Title
t

Travis Griggs

05/01/2023, 3:48 PM
To attempt to try and learn, I've placed this in my top level Column of my little play app:
val isVisible = WindowInsets.isImeVisible
LaunchedEffect(WindowInsets.isImeVisible) { println(">>>>>> KEYBOARD HAPPENED!! $isVisible") }
When I tap a TextBox and the keyboard comes up, I get the following in Logcat:
>>>>>> KEYBOARD HAPPENED!! true
When I dismiss the keyboard with the
Done
button, I see:
>>>>>> KEYBOARD HAPPENED!! false
>>>>>> KEYBOARD HAPPENED!! true
>>>>>> KEYBOARD HAPPENED!! false
Why do I get the back and forth on dismissal? Why not just one false?
a

Alex Vanyo

05/01/2023, 3:51 PM
Which method are you using to hide the keyboard upon hitting
Done
?
t

Travis Griggs

05/01/2023, 3:53 PM
keyboardOptions = KeyboardOptions(imeAction = ImeAction.Done),
keyboardActions = KeyboardActions.Default
I just tap the Done button with those settings
a

Alex Vanyo

05/10/2023, 2:38 PM
It sounds like this is related to https://issuetracker.google.com/issues/278739418 . You could try using the workaround in that issue and call
inputMethodManager.hideSoftInputFromWindow
directly for
Done
instead of relying on the internal default