Skip to content

Commit 6b19fcf

Browse files
author
Stefano Malagò
committed
Only prevent space from scrolling, allow other default behaviours
1 parent d16c815 commit 6b19fcf

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

frontend/src/hooks/withKeyboard.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,8 +23,9 @@ function withKeyboard(action: (command: string) => void) {
2323
return
2424
} // some element is selected (typing)
2525

26-
event.preventDefault() // prevent scroll on space in case of scrollable page
2726
const key = event.key
27+
if (key == ' ') event.preventDefault() // prevent scroll on space in case of scrollable page
28+
2829
if (key == 'Escape') {
2930
setCommand('')
3031
} else if (key == 'Enter' || key == ' ') {

0 commit comments

Comments
 (0)