mirror of
https://github.com/owenlejeune/AirHockey.git
synced 2025-11-18 05:20:54 -05:00
Event listener to prevent page scroll on key press added
This commit is contained in:
@@ -132,7 +132,8 @@ window.addEventListener("beforeunload", (e) => {
|
||||
});
|
||||
|
||||
window.addEventListener("keydown", (e) => {
|
||||
if(e.which == RIGHT_ARROW || e.which == LEFT_ARROW || e.which == UP_ARROW || e.which == DOWN_ARROW){
|
||||
if(e.which == RIGHT_ARROW || e.which == LEFT_ARROW
|
||||
|| e.which == UP_ARROW || e.which == DOWN_ARROW){
|
||||
e.preventDefault();
|
||||
}
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user