Skip to content

Commit

Permalink
Merge pull request #41687 from nextcloud/fix/unified-search-view
Browse files Browse the repository at this point in the history
fix(core): Subscribe to navigation changes on mounted for Unified search
  • Loading branch information
susnux authored Nov 23, 2023
2 parents 5f159d4 + fca05f4 commit a9c627c
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 5 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
Loading

0 comments on commit a9c627c

Please sign in to comment.