Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions app/components/Compare/PackageSelector.vue
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,8 @@ const resultIndexOffset = computed(() => (showNoDependencyOption.value ? 1 : 0))

const numberFormatter = useNumberFormatter()

const keyboardShortcuts = useKeyboardShortcuts()

function addPackage(name: string) {
if (packages.value.length >= maxPackages.value) return
if (packages.value.includes(name)) return
Expand All @@ -98,6 +100,10 @@ function removePackage(name: string) {
}

function handleKeydown(e: KeyboardEvent) {
if (!keyboardShortcuts.value) {
return
}

const items = navigableItems.value
const count = items.length

Expand Down
5 changes: 5 additions & 0 deletions app/pages/search.vue
Original file line number Diff line number Diff line change
Expand Up @@ -463,7 +463,12 @@ function focusSearchInput() {
searchInput?.focus()
}

const keyboardShortcuts = useKeyboardShortcuts()

function handleResultsKeydown(e: KeyboardEvent) {
if (!keyboardShortcuts.value) {
return
}
// If the active element is an input, navigate to exact match or wait for results
if (e.key === 'Enter' && document.activeElement?.tagName === 'INPUT') {
// Get value directly from input (not from route query, which may be debounced)
Expand Down
Loading