Details
-
Bug
-
Resolution: Cannot Reproduce
-
P2: Important
-
5.7.1, 5.8.0
-
None
-
Android 4.4, 7.1.1
Qt from online installer,
Android SDK Tools 25.2.5
Description
My application uses Keys.onBackPressed to override Android back button press to use it for manual navigation through pages.
I discovered that after using Popup with focused TextField, most parent component (StackView in my case) does not receive Keys.onBackPressed after Popup is closed and so the app quits.
When using TextField not in Popup, pressing HW back button works as excepted - first it closes on-screen keyboard, and for the second press Keys.onBackPressed is handled that allows to handle navigation and exit that specific page.
I have attached example application where you can see two use cases - "simple" TextField with activeFocuse and TextField in Popup with activeFocus.
Workaround is to uncomment line //onClosed: mainStack.forceActiveFocus(), i.e. manually fix focus. If this is by design, it means I can expect losing focus "anywhere" in the future of app development and makes managing keyboard navigation more explicit and complicated.