3 ms·
The issue should now be fixed thanks to the following code : // prevent itch.io scrolling window.addEventListener("keydown", function (e) {
by JSLegendDev 3y ago
The issue should now be fixed thanks to the following code :
// prevent itch.io scrolling
window.addEventListener("keydown", function (e) {
if ([32, 37, 38, 39, 40].indexOf(e.keyCode) > -1) {
e.preventDefault();
}
});
- deepfriedrice 3y agoObligatory pedantry https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/includes https://developer.mozilla.org/en-US/docs/Web/JavaScript/Refe...
- gibolt 3y agokeyCode is deprecated. 'key' would be optimal and more readable :D https://stackoverflow.com/a/44213036/974045 https://stackoverflow.com/a/44213036/974045