Overview: Fix clear button working in overview search

onTextEdited only updates on user-invoked key presses, and not
programatic changes.

This is a better choice when we have a two-way bindings such  as with
configuration files, but in this case we always want the UI to reflect
the current contents of the search box making onTextChanged the better
signal.

BUG: 475789
This commit is contained in:
David Edmundson 2023-10-25 11:52:56 +00:00
parent 6033d2d14e
commit 4bdb94c87f

View file

@ -264,7 +264,8 @@ FocusScope {
Keys.priority: Keys.BeforeItem
Keys.forwardTo: text && (allDesktopHeaps.currentHeap.count === 0 || !effect.filterWindows) ? searchResults : allDesktopHeaps.currentHeap
text: effect.searchText
onTextEdited: {
// not onTextEdited so that the UI always stays in sync
onTextChanged: {
effect.searchText = text;
allDesktopHeaps.currentHeap.resetSelected();
allDesktopHeaps.currentHeap.selectNextItem(WindowHeap.Direction.Down);