Skip to content

Commit 2df5178

Browse files
committed
fix: do not scroll the page when space key is pressed
1 parent ee639a0 commit 2df5178

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

src/src/util/shortcuts.js

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,6 @@
22

33
define(['jquery'], function ($) {
44
$(document).keydown(function (event) {
5-
// If Control or Command key is pressed and the S key is pressed
6-
// run save function. 83 is the key code for S.
75
if (
86
(event.ctrlKey || event.metaKey) &&
97
!event.altKey &&
@@ -13,6 +11,9 @@ define(['jquery'], function ($) {
1311
require(['src/util/searchBox'], function (searchModule) {
1412
searchModule();
1513
});
14+
} else if (event.key === ' ') {
15+
// Avoid scrolling the page. The space key can be used by modules.
16+
event.preventDefault();
1617
}
1718
});
1819
});

0 commit comments

Comments
 (0)