I just tried a very ugly hack to work around the issue:

TextField {
  objectName: "addressBarTextField"
  onActiveFocusChanged: {
    if (activeFocus) {
      var textInput = findChild(textField, "text_input")
      console.log("address bar got active focus, text input =", textInput)
      textInput.forceActiveFocus()
      console.log("after forcing active focus on text input", textInput)
    }
  }
}

Where findChild() is copied from UbuntuTestCase to recursively search for a 
given descendant by objectName.
Well I’m seeing this output:

qml: AFI: QQuickTextInput(0xb779c760, "text_input")
qml: address bar got active focus, text input = QQuickTextInput(0xb779c760, 
"text_input")
qml: after forcing active focus on text input QQuickTextInput(0xb779c760, 
"text_input")
qml: AFI: TextField_QMLTYPE_61_QML_146(0xb7793c28, "addressBarTextField")

So this hack isn’t even working. But it seems to indicate that active
focus is removed from the TextInput, but remains on the ancestor
TextField. Why that happens remains to be explained.

-- 
You received this bug notification because you are a member of Ubuntu
Bugs, which is subscribed to Ubuntu.
https://bugs.launchpad.net/bugs/1545802

Title:
  activeFocus not being forwarded to TextInput inside TextField

To manage notifications about this bug go to:
https://bugs.launchpad.net/ubuntu/+source/ubuntu-ui-toolkit/+bug/1545802/+subscriptions

-- 
ubuntu-bugs mailing list
ubuntu-bugs@lists.ubuntu.com
https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs

Reply via email to