To attempt to try and learn, I've placed this in m...
# compose-android
t
To attempt to try and learn, I've placed this in my top level Column of my little play app:
Copy code
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:
Copy code
>>>>>> KEYBOARD HAPPENED!! true
When I dismiss the keyboard with the
Done
button, I see:
Copy code
>>>>>> 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
Which method are you using to hide the keyboard upon hitting
Done
?
t
Copy code
keyboardOptions = KeyboardOptions(imeAction = ImeAction.Done),
keyboardActions = KeyboardActions.Default
I just tap the Done button with those settings
a
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