File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree 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 @@ -69,7 +69,13 @@ function closeDropdown() {
6969 focusedIndex .value = - 1
7070}
7171
72+ const keyboardShortcuts = useKeyboardShortcuts ()
73+
7274function handleKeydown(event : KeyboardEvent ) {
75+ if (! keyboardShortcuts .value ) {
76+ return
77+ }
78+
7379 if (! isOpen .value ) {
7480 if (event .key === ' ArrowDown' || event .key === ' Enter' || event .key === ' ' ) {
7581 event .preventDefault ()
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