From fb5a67ef17e232ce2188012a94279a69f89946d4 Mon Sep 17 00:00:00 2001 From: Mathieu Pellerin Date: Mon, 30 Sep 2024 15:08:46 +0700 Subject: [PATCH] Insure that search bar reacts to partial text entered by all virtual keyboards --- src/qml/RelationCombobox.qml | 4 ++-- src/qml/imports/Theme/QfSearchBar.qml | 6 +++++- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/src/qml/RelationCombobox.qml b/src/qml/RelationCombobox.qml index a2ef732004..679d05fa20 100644 --- a/src/qml/RelationCombobox.qml +++ b/src/qml/RelationCombobox.qml @@ -69,7 +69,7 @@ Item { onOpened: { if (searchableText.typedFilter != '') { - searchBar.searchTerm = searchableText.typedFilter; + searchBar.setSearchTerm(searchableText.typedFilter); } if (resultsList.contentHeight > resultsList.height) { searchBar.focusOnTextField(); @@ -99,7 +99,7 @@ Item { height: childrenRect.height onSearchTermChanged: { - featureListModel.searchTerm = searchTerm; + featureListModel.setSearchTerm(searchTerm); } onReturnPressed: { diff --git a/src/qml/imports/Theme/QfSearchBar.qml b/src/qml/imports/Theme/QfSearchBar.qml index 420503c933..75f7eb2306 100644 --- a/src/qml/imports/Theme/QfSearchBar.qml +++ b/src/qml/imports/Theme/QfSearchBar.qml @@ -6,7 +6,7 @@ import Theme Item { id: searchBar - property alias searchTerm: searchField.text + property alias searchTerm: searchField.displayText property string placeHolderText: qsTr("Search") signal returnPressed @@ -71,6 +71,10 @@ Item { searchField.forceActiveFocus(); } + function setSearchTerm(term) { + searchField.text = term; + } + function clear() { searchField.text = ''; }