Mobile/filtering: ensure filter input field has focus when shown

QML's logic for who gets focus is a bit complicated. But forceActiveFocus()
cuts through the confusion and makes sure that your field does indeed get
focus.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This commit is contained in:
Dirk Hohndel 2018-10-19 06:54:34 -04:00
parent fd31dfe40d
commit 97e6494eee

View file

@ -418,6 +418,9 @@ Kirigami.ScrollablePage {
onVisibleChanged: {
// reset the filter when it gets toggled
text = ""
if (visible) {
forceActiveFocus()
}
}
}
Controls.Label {