mirror of
https://github.com/nextcloud/server.git
synced 2026-05-28 04:32:30 -04:00
fix(core): skip unified-search Ctrl+F on pages with their own handler
-e Signed-off-by: Peter Ringelmann <peter.ringelmann@nextcloud.com>
This commit is contained in:
parent
6f5ede3412
commit
ea6e031e04
1 changed files with 15 additions and 1 deletions
|
|
@ -83,7 +83,17 @@ export default defineComponent({
|
|||
*/
|
||||
supportsLocalSearch() {
|
||||
// TODO: Make this an API
|
||||
const providerPaths = ['/settings/users', '/apps/deck', '/settings/apps']
|
||||
const providerPaths = ['/apps/deck', '/settings/apps']
|
||||
return providerPaths.some((path) => this.currentLocation.pathname?.includes?.(path))
|
||||
},
|
||||
|
||||
/**
|
||||
* Current page handles the Ctrl+F shortcut itself (e.g. has a dedicated
|
||||
* search input). UnifiedSearch should stay out of the way on these pages.
|
||||
*/
|
||||
appHandlesSearchShortcut() {
|
||||
// TODO: Make this an API
|
||||
const providerPaths = ['/settings/users']
|
||||
return providerPaths.some((path) => this.currentLocation.pathname?.includes?.(path))
|
||||
},
|
||||
},
|
||||
|
|
@ -135,6 +145,10 @@ export default defineComponent({
|
|||
*/
|
||||
onKeyDown(event: KeyboardEvent) {
|
||||
if (event.ctrlKey && event.key === 'f') {
|
||||
// Skip on pages that handle Ctrl+F themselves (e.g. a dedicated search input).
|
||||
if (this.appHandlesSearchShortcut) {
|
||||
return
|
||||
}
|
||||
// only handle search if not already open - in this case the browser native search should be used
|
||||
if (!this.showLocalSearch && !this.showUnifiedSearch) {
|
||||
event.preventDefault()
|
||||
|
|
|
|||
Loading…
Reference in a new issue