Is there any way to add a callback for when the user closes the software keyboard in Compose? I want to unfocus my TextField when the user closes the keyboard, so that they don't have to press the back button 3 times to exit a search query. (Currently it's once to close the keyboard, a second time to unfocus the TextField, and then only the third time does my custom BackHandler get called, to exit the search page.)
1 year ago
Compose 1.1.0-alpha01 fixes this I believe (or 1.0.1) as I had the same issue and it resolved itself once I updated!
Thanks! After updating, the TextField no longer consumes the back press event when focused and not showing the keyboard, so my custom BackHandler is now called to exit the search page. Curiously, this behavior is not exactly what is described in that release note, and it seems like there is no way to achieve my original goal of unfocusing the TextField when the keyboard is dismissed (I know this is at least possible with the View system because Spotify's search does it).