Skip to content
Snippets Groups Projects
Commit 6aa33133 authored by Paul Kaplan's avatar Paul Kaplan
Browse files

Prevent arrow/space from scrolling the page

This is needed to make the project page work as expected. In the future, investing in ways of making those accessility features work would be good. But for now, it is broken for everyone because it both sends events to the VM _and_ scrolls the page.
parent 189a78d2
No related branches found
No related tags found
No related merge requests found
......@@ -82,6 +82,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