fac26 / week5-client-side-niete-laura

0 stars 0 forks source link

Disable arrow key scrolling in players browsers #34

Open konstantinakatmada opened 1 year ago

konstantinakatmada commented 1 year ago

I am not certain as to why this is happening to me (Safari as browser) and not my teammate (Chrome as browser) but my page gets moved down, right, left etc. by the corresponding arrows when I try to play at the localhost.

Adding a preventDefault() method would ascertain that the default browser action of using the arrows to move the page is blocked, as in [here](https://stackoverflow.com/questions/8916620/disable-arrow-key-scrolling-in-users-browser#:~:text=preventDefault()%3B%20.,the%20viewpoint%20of%20the%20browser.) .