summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLeah (ctucx) <leah@ctu.cx>2021-03-13 02:07:57 +0100
committerLeah (ctucx) <leah@ctu.cx>2021-03-13 02:14:20 +0100
commitae445a4330e1436edcce6c35307a3b2a19970ae0 (patch)
tree12f7faea5acd90daa2630e4312b95774f9d5ecb2
parentec45c22794519368755856cd7da249842bfe4633 (diff)
downloadwebmusic-nginx-ae445a4330e1436edcce6c35307a3b2a19970ae0.tar.gz
webmusic-nginx-ae445a4330e1436edcce6c35307a3b2a19970ae0.tar.bz2
webmusic-nginx-ae445a4330e1436edcce6c35307a3b2a19970ae0.zip
webmusic.js: prevent default action for keydown events
-rw-r--r--webmusic.js3
1 files changed, 3 insertions, 0 deletions
diff --git a/webmusic.js b/webmusic.js
index cf5ac73..80716da 100644
--- a/webmusic.js
+++ b/webmusic.js
@@ -11,6 +11,9 @@ let onlyDirs = true;
const handleKeyEvent = (event) => {
if (event.ctrlKey === true || event.altKey === true) return;
+ event.preventDefault();
+ event.stopPropagation();
+
switch (event.key) {
case ' ':
case 'p':