From 97f1dc0b0186fc28056f091fa346f60228f7ce2c Mon Sep 17 00:00:00 2001 From: Joakim Bygdell Date: Mon, 31 Jul 2017 15:55:30 +0200 Subject: 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 --- mobile-widgets/qml/HintsTextEdit.qml | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'mobile-widgets/qml/HintsTextEdit.qml') diff --git a/mobile-widgets/qml/HintsTextEdit.qml b/mobile-widgets/qml/HintsTextEdit.qml index 5bf57207f..4ed3b51ab 100644 --- a/mobile-widgets/qml/HintsTextEdit.qml +++ b/mobile-widgets/qml/HintsTextEdit.qml @@ -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 { } -- cgit v1.2.3-70-g09d2