Skip to content

Commit ed9aa87

Browse files
committed
impr: prevent space from scrolling the page when on the result page
1 parent 892b7d0 commit ed9aa87

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

frontend/src/ts/ui.ts

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,10 @@ if (isDevEnvironment()) {
6767

6868
//stop space scrolling
6969
window.addEventListener("keydown", function (e) {
70-
if (e.code === "Space" && e.target === document.body) {
70+
if (
71+
e.code === "Space" &&
72+
(e.target === document.body || (e.target as HTMLElement)?.id === "result")
73+
) {
7174
e.preventDefault();
7275
}
7376
});

0 commit comments

Comments
 (0)