Skip to content

Commit

Permalink
Merge pull request #41708 from nextcloud/backport/41687/stable28
Browse files Browse the repository at this point in the history
[stable28] fix(core): Subscribe to navigation changes on mounted for Unified search
  • Loading branch information
AndyScherzinger authored Nov 24, 2023
2 parents 0d478a0 + 076abb6 commit 36109fd
Show file tree
Hide file tree
Showing 5 changed files with 10 additions and 8 deletions.
6 changes: 4 additions & 2 deletions core/src/views/UnifiedSearch.vue
Original file line number Diff line number Diff line change
Expand Up @@ -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)
},
Expand All @@ -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
}
Expand Down Expand Up @@ -383,7 +385,7 @@ export default {
},

onNavigationChange() {
this.$el.querySelector('form[role="search"]').reset()
this.$el?.querySelector?.('form[role="search"]')?.reset?.()
},

/**
Expand Down
4 changes: 2 additions & 2 deletions dist/core-common.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion dist/core-common.js.map

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions dist/core-unified-search.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion dist/core-unified-search.js.map

Large diffs are not rendered by default.

0 comments on commit 36109fd

Please sign in to comment.