Event listener to prevent page scroll on key press added

This commit is contained in:
2018-03-08 12:51:55 -05:00
parent e349038569
commit e33f350a1e

View File

@@ -131,6 +131,12 @@ window.addEventListener("beforeunload", (e) => {
leaveGame(); leaveGame();
}); });
window.addEventListener("keydown", (e) => {
if(e.which == RIGHT_ARROW || e.which == LEFT_ARROW || e.which == UP_ARROW || e.which == DOWN_ARROW){
e.preventDefault();
}
});
function printSpectators(names){ function printSpectators(names){
var spectators = names; var spectators = names;
console.log(spectators); console.log(spectators);