From a3c6db3ee7c7aad33879cf774c28c7022f4788eb Mon Sep 17 00:00:00 2001 From: ivan tkachenko Date: Sat, 17 Sep 2022 02:44:15 +0300 Subject: [PATCH] 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 --- src/effects/windowview/qml/main.qml | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/src/effects/windowview/qml/main.qml b/src/effects/windowview/qml/main.qml index 82e61c3c70..b8afeeb91f 100644 --- a/src/effects/windowview/qml/main.qml +++ b/src/effects/windowview/qml/main.qml @@ -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: {