diff options
author | John Molakvoæ <skjnldsv@users.noreply.github.com> | 2024-03-01 11:01:57 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-03-01 11:01:57 +0100 |
commit | 6d774379c885f4537e1dd76dff4e5b121066d6ed (patch) | |
tree | 25675eae99577b207601b07267004cf21fa60d36 /core | |
parent | b51275ce11cf88669197179ee8f42e613313bc43 (diff) | |
parent | 19377fac16919d627f0590f891a1b6a59e4bb73b (diff) | |
download | nextcloud-server-6d774379c885f4537e1dd76dff4e5b121066d6ed.tar.gz nextcloud-server-6d774379c885f4537e1dd76dff4e5b121066d6ed.zip |
Merge pull request #43665 from nextcloud/43365-unified-search-filter-view-fix
Diffstat (limited to 'core')
-rw-r--r-- | core/src/views/UnifiedSearchModal.vue | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/core/src/views/UnifiedSearchModal.vue b/core/src/views/UnifiedSearchModal.vue index 9c719d2bcf6..101859f950f 100644 --- a/core/src/views/UnifiedSearchModal.vue +++ b/core/src/views/UnifiedSearchModal.vue @@ -237,6 +237,14 @@ export default { }, watch: { isVisible(value) { + if (value) { + /* + * Before setting the search UI to visible, reset previous search event emissions. + * This allows apps to restore defaults after "Filter in current view" if the user opens the search interface once more. + * Additionally, it's a new search, so it's better to reset all previous events emitted. + */ + emit('nextcloud:unified-search.reset', { query: '' }) + } this.internalIsVisible = value }, internalIsVisible(value) { @@ -265,9 +273,9 @@ export default { if (query.length === 0) { this.results = [] this.searching = false + emit('nextcloud:unified-search.reset', { query }) return } - // Event should probably be refactored at some point to used nextcloud:unified-search.search emit('nextcloud:unified-search.search', { query }) const newResults = [] const providersToSearch = this.filteredProviders.length > 0 ? this.filteredProviders : this.providers |