I am developing an Android (Jetpack Compose) app and have observed that when a textfield gains focus, a software (IME) keyboard opens, and remains open even after I click outside the field.

This is the default behavior from the programming side and there don't appear to be Android APIs that do something similar in another way.

My intuition is that such behavior is wrong and instead the following behavior should happen: if the user clicks outside the TextField, then the TextField should lose the focus (there may be no focused component) and the software keyboard should be hidden. Of course, if the user clicks outside the original TextField but inside another TextField, then it is different - new TextField should acquire focus and should keep the IME keyboard open.

Isn't that more intuitive for the user? Or should the keyboard remain open until the user dismisses it, or something else happens?

1 Answer 1


As I see it in many apps, the IME should only disappear when the user clicks something that is clickable e.g. a button. If the user clicks some whitespace, image or text I would assume it was by accident and the "pain" to get back the keyboard is bigger than the user having to learn to use the back button or gesture to close the keyboard.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.