Skip to content

Commit

Permalink
fix(core): Subscribe to navigation changes on mounted for Unified search
Browse files Browse the repository at this point in the history
Signed-off-by: Ferdinand Thiessen <opensource@fthiessen.de>
  • Loading branch information
susnux committed Nov 23, 2023
1 parent c5caae1 commit fca05f4
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 fca05f4

Please sign in to comment.