Skip to content

Commit 09bd874

Browse files
committed
feat: fix single selection with space (#363)
1 parent 35f16f0 commit 09bd874

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

packages/core/src/hotkeys/useHotkey.ts

+2-1
Original file line numberDiff line numberDiff line change
@@ -56,8 +56,9 @@ export const useHotkey = (
5656
.reduce((a, b) => a || b, false);
5757

5858
if (partialMatch) {
59-
if (pressedKeys.current.length > 1 || !/^[a-zA-Z]$/.test(e.key)) {
59+
if (pressedKeys.current.length > 1 || !/^[a-zA-Z\s]$/.test(e.key)) {
6060
// Prevent default, but not if this is the first input and a letter (which should trigger a search)
61+
// also not on first input and spacebar, as that should trigger an item directly
6162
e.preventDefault();
6263
}
6364
}

0 commit comments

Comments
 (0)