Skip to content

Commit

Permalink
Insure that search bar reacts to partial text entered by all virtual …
Browse files Browse the repository at this point in the history
…keyboards
  • Loading branch information
nirvn committed Oct 1, 2024
1 parent 6d99045 commit 3a1586f
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 3 deletions.
4 changes: 2 additions & 2 deletions src/qml/RelationCombobox.qml
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ Item {

onOpened: {
if (searchableText.typedFilter != '') {
searchBar.searchTerm = searchableText.typedFilter;
searchBar.setSearchTerm(searchableText.typedFilter);
}
if (resultsList.contentHeight > resultsList.height) {
searchBar.focusOnTextField();
Expand Down Expand Up @@ -99,7 +99,7 @@ Item {
height: childrenRect.height

onSearchTermChanged: {
featureListModel.searchTerm = searchTerm;
featureListModel.setSearchTerm(searchTerm);
}

onReturnPressed: {
Expand Down
6 changes: 5 additions & 1 deletion src/qml/imports/Theme/QfSearchBar.qml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -71,6 +71,10 @@ Item {
searchField.forceActiveFocus();
}

function setSearchTerm(term) {
searchField.text = term;
}

function clear() {
searchField.text = '';
}
Expand Down

1 comment on commit 3a1586f

@qfield-fairy
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.