From cf337a75a2beea6900ceb0d3533f5a0020dd1655 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20Calvi=C3=B1o=20S=C3=A1nchez?= Date: Wed, 16 Jul 2025 05:40:07 +0200 Subject: [PATCH] fix: Fix clearing unified search when modal is closed MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The unified search modal was intended to be cleared when closed. However, "UnifiedSearchModal" did not emit "update:query" when its internal query value ("searchQuery") changed, so "UnifiedSearch.query" was kept as an empty string. When the modal was closed "update:query" was emitted with an empty string, which should have cleared "UnifiedSearch.query" and that, in turn, should have cleared the modal. However as "UnifiedSearch.query" was already an empty string the watcher that updates "UnifiedSearchModal.searchQuery" from "UnifiedSearch.query" was not triggered and the modal was not cleared. As "UnifiedSearch.query" is now updated with the value of "UnifiedSearchModal.searchQuery" the latter can not be trimmed when updated from the former, as that would in turn also trim "UnifiedSearchModal.searchQuery" and prevent to search for anything with spaces at the beginning or end (even if those trailing spaces are just temporary while writing something like "searched value"). Signed-off-by: Daniel Calviño Sánchez --- core/src/components/UnifiedSearch/UnifiedSearchModal.vue | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/core/src/components/UnifiedSearch/UnifiedSearchModal.vue b/core/src/components/UnifiedSearch/UnifiedSearchModal.vue index 1edfbd45746..744c8e604fa 100644 --- a/core/src/components/UnifiedSearch/UnifiedSearchModal.vue +++ b/core/src/components/UnifiedSearch/UnifiedSearchModal.vue @@ -329,7 +329,13 @@ export default defineComponent({ query: { immediate: true, handler() { - this.searchQuery = this.query.trim() + this.searchQuery = this.query + }, + }, + + searchQuery: { + handler() { + this.$emit('update:query', this.searchQuery) }, }, },