From 076abb661be7591bee7dee16c2e6b819c18bca08 Mon Sep 17 00:00:00 2001 From: Ferdinand Thiessen Date: Thu, 23 Nov 2023 13:19:13 +0100 Subject: fix(core): Subscribe to navigation changes on mounted for Unified search Signed-off-by: Ferdinand Thiessen Signed-off-by: nextcloud-command --- core/src/views/UnifiedSearch.vue | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'core/src') diff --git a/core/src/views/UnifiedSearch.vue b/core/src/views/UnifiedSearch.vue index 0b7c9a29cec..3a136c501e9 100644 --- a/core/src/views/UnifiedSearch.vue +++ b/core/src/views/UnifiedSearch.vue @@ -334,7 +334,6 @@ export default { }, async created() { - subscribe('files:navigation:changed', this.onNavigationChange) this.types = await getTypes() this.logger.debug('Unified Search initialized with the following providers', this.types) }, @@ -344,6 +343,9 @@ export default { }, mounted() { + // subscribe in mounted, as onNavigationChange relys on $el + subscribe('files:navigation:changed', this.onNavigationChange) + if (OCP.Accessibility.disableKeyboardShortcuts()) { return } @@ -383,7 +385,7 @@ export default { }, onNavigationChange() { - this.$el.querySelector('form[role="search"]').reset() + this.$el?.querySelector?.('form[role="search"]')?.reset?.() }, /** -- cgit v1.2.3