effects/windowview: Bind to search field using textEdited signal

This special signal was designed to remove the need for such
bikesheddings and workarounds. Use it to react to user-driven changes.

FIXED-IN: 5.26
This commit is contained in:
ivan tkachenko 2022-09-17 02:44:15 +03:00
parent 984388dba4
commit a3c6db3ee7
No known key found for this signature in database
GPG key ID: AF72731B7C654CB3

View file

@ -106,18 +106,13 @@ Item {
OpacityAnimator { duration: container.effect.animationDuration; easing.type: Easing.OutCubic }
}
// Binding loops will be avoided from the fact that setting the text to the same won't emit textChanged
// We can't use activeFocus because is not reliable on qml effects
onTextChanged: {
text: effect.searchText
onTextEdited: {
effect.searchText = text;
heap.resetSelected();
heap.selectNextItem(WindowHeap.Direction.Down);
}
Binding {
target: searchField
property: "text"
value: effect.searchText
}
Keys.priority: Keys.AfterItem
Keys.forwardTo: heap
Keys.onPressed: {