File tree Expand file tree Collapse file tree 2 files changed +11
-0
lines changed
Expand file tree Collapse file tree 2 files changed +11
-0
lines changed Original file line number Diff line number Diff line change @@ -75,6 +75,8 @@ const resultIndexOffset = computed(() => (showNoDependencyOption.value ? 1 : 0))
7575
7676const numberFormatter = useNumberFormatter ()
7777
78+ const keyboardShortcuts = useKeyboardShortcuts ()
79+
7880function addPackage(name : string ) {
7981 if (packages .value .length >= maxPackages .value ) return
8082 if (packages .value .includes (name )) return
@@ -98,6 +100,10 @@ function removePackage(name: string) {
98100}
99101
100102function handleKeydown(e : KeyboardEvent ) {
103+ if (! keyboardShortcuts .value ) {
104+ return
105+ }
106+
101107 const items = navigableItems .value
102108 const count = items .length
103109
Original file line number Diff line number Diff line change @@ -463,7 +463,12 @@ function focusSearchInput() {
463463 searchInput ?.focus ()
464464}
465465
466+ const keyboardShortcuts = useKeyboardShortcuts ()
467+
466468function handleResultsKeydown(e : KeyboardEvent ) {
469+ if (! keyboardShortcuts .value ) {
470+ return
471+ }
467472 // If the active element is an input, navigate to exact match or wait for results
468473 if (e .key === ' Enter' && document .activeElement ?.tagName === ' INPUT' ) {
469474 // Get value directly from input (not from route query, which may be debounced)
You can’t perform that action at this time.
0 commit comments