aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDaniel Calviño Sánchez <danxuliu@gmail.com>2025-07-16 05:40:07 +0200
committerbackportbot[bot] <backportbot[bot]@users.noreply.github.com>2025-07-17 11:41:06 +0000
commitea02e34bfc3425e223281c84ce2cd23e7910ddcf (patch)
tree78b31bc2f9fc724915f4212f9f1f5aa8eac347c0
parent3c9904a04f5ebdf556e040923cd5ea54f2075fad (diff)
downloadnextcloud-server-ea02e34bfc3425e223281c84ce2cd23e7910ddcf.tar.gz
nextcloud-server-ea02e34bfc3425e223281c84ce2cd23e7910ddcf.zip
fix: Fix clearing unified search when modal is closed
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 <danxuliu@gmail.com>
-rw-r--r--core/src/components/UnifiedSearch/UnifiedSearchModal.vue8
1 files changed, 7 insertions, 1 deletions
diff --git a/core/src/components/UnifiedSearch/UnifiedSearchModal.vue b/core/src/components/UnifiedSearch/UnifiedSearchModal.vue
index 02450da4d11..c3e632e5290 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)
},
},
},