Skip to content
Snippets Groups Projects
Unverified Commit a3431a99 authored by Paul Kaplan's avatar Paul Kaplan Committed by GitHub
Browse files

Merge pull request #3880 from paulkaplan/prevent-space-scroll

Prevent arrow/space from scrolling the page
parents a06fad33 6aa33133
No related branches found
No related tags found
No related merge requests found
......@@ -83,6 +83,12 @@ const vmListenerHOC = function (WrappedComponent) {
key: e.key,
isDown: true
});
// Prevent space/arrow key from scrolling the page.
if (e.keyCode === 32 || // 32=space
(e.keyCode >= 37 && e.keyCode <= 40)) { // 37, 38, 39, 40 are arrows
e.preventDefault();
}
}
handleKeyUp (e) {
// Always capture up events,
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment