QML UI: autocomplete objects should lose focus on selection

When the user makes a selection using the autocomplete function while editing a dive the keyboard should close and the selection list should disappear.

Signed-off-by: Joakim Bygdell <j.bygdell@gmail.com>
This commit is contained in:
Joakim Bygdell 2017-07-31 15:55:30 +02:00 committed by Dirk Hohndel
parent 9e9e06aed6
commit 97f1dc0b01
2 changed files with 6 additions and 1 deletions

View file

@ -156,6 +156,7 @@ Item {
Kirigami.Label {
Layout.alignment: Qt.AlignRight
text: qsTr("Air Temp:")
font.pointSize: subsurfaceTheme.smallPointSize
}
TextField {
id: txtAirTemp

View file

@ -15,6 +15,7 @@ TextField {
textUpdateTimer.restart();
}
onFocusChanged: frame.shouldShow = focus
onVisibleChanged: {
if (visible) {
focus = false
@ -27,6 +28,9 @@ TextField {
Keys.onDownPressed: {
hintsView.currentIndex++;
}
Keys.onReturnPressed: {
focus = false
}
Timer {
id: textUpdateTimer
interval: 300
@ -107,7 +111,7 @@ TextField {
onClicked: {
hintsView.currentIndex = index
root.text = modelData
frame.shouldShow = false;
root.focus = false;
}
}
ScrollBar.vertical: ScrollBar { }