activeFocus not being forwarded to TextInput inside TextField

Bug #1545802 reported by Olivier Tilloy
34
This bug affects 5 people
Affects Status Importance Assigned to Milestone
Canonical System Image
Fix Released
Critical
Zoltan Balogh
ubuntu-ui-toolkit (Ubuntu)
Fix Committed
Critical
Cris Dywan
ubuntu-ui-toolkit (Ubuntu RTM)
New
Undecided
Unassigned
webbrowser-app (Ubuntu)
Fix Released
High
Olivier Tilloy

Bug Description

Haven’t managed to reproduce with a standalone example yet, but I can reliably reproduce the following issue with the browser app on a tablet with a bluetooth keyboard connected (this needs to be on a tablet so that the wide layout of the app is used, for example with a Nexus 7 (flo) in landscape orientation):

 1) launch the browser app with a bluetooth keyboard attached and ensure that the current tab is not a new tab
 2) press Ctrl+T to open a new tab

Expected result: the address bar gets active focus so that the user can start entering a URL right away

Current result: the address bar gets active focus for a fraction of a second, then looses it. When that happens, pressing Ctrl+L (which forces focus on the address bar) doesn’t fix it.

I added some debugging to the browser (printing Window.activeFocusItem whenever it changes), and it appears that when initially forcing active focus on the address bar the QQuickTextInput inside it gets active focus, then looses it. At that point the activeFocusItem is the TextField, but it doesn’t forward it to QQuickTextInput inside itself.

That situation can be remedied by using a bluetooth mouse to click on the address bar, which restores active focus on the QQuickTextInput.

Tags: