We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent e85b953 commit 9aa54fdCopy full SHA for 9aa54fd
1 file changed
packages/ui/src/hooks/use-filtered-list.tsx
@@ -82,6 +82,15 @@ export function useFilteredList<T>(props: FilteredListProps<T>) {
82
const selectedIndex = flat().findIndex((x) => props.key(x) === list.active())
83
const selected = flat()[selectedIndex]
84
if (selected) props.onSelect?.(selected, selectedIndex)
85
+ } else if (event.ctrlKey && !event.metaKey && !event.altKey && !event.shiftKey) {
86
+ if (event.key === "n" || event.key === "p") {
87
+ event.preventDefault()
88
+ const navEvent = new KeyboardEvent("keydown", {
89
+ key: event.key === "n" ? "ArrowDown" : "ArrowUp",
90
+ bubbles: true,
91
+ })
92
+ list.onKeyDown(navEvent)
93
+ }
94
} else {
95
// Skip list navigation for text editing shortcuts (e.g., Option+Arrow, Option+Backspace on macOS)
96
if (event.altKey || event.metaKey) return
0 commit comments