Skip to content

Commit

Permalink
feat(UnifiedSearch): Restore ctrl+f activates unified search
Browse files Browse the repository at this point in the history
`CTRL+F` is a common search shortcut and should activate Unified Search on Nextcloud.

Resolves : #44160

Signed-off-by: fenn-cs <[email protected]>
  • Loading branch information
nfebe committed Jun 26, 2024
1 parent 5dcb807 commit 665da7e
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions core/src/views/UnifiedSearch.vue
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,10 @@ export default {
},
mounted() {
console.debug('Unified search initialized!')
window.addEventListener('keydown', this.handleKeyDown)
},
beforeDestroy() {
window.removeEventListener('keydown', this.handleKeyDown)
},
methods: {
toggleUnifiedSearch() {
Expand All @@ -43,6 +47,12 @@ export default {
handleModalVisibilityChange(newVisibilityVal) {
this.showUnifiedSearch = newVisibilityVal
},
handleKeyDown(event) {
if (event.ctrlKey && event.key === 'f') {
event.preventDefault()
this.showUnifiedSearch = true
}
},
},
}
</script>
Expand Down

0 comments on commit 665da7e

Please sign in to comment.