Parcourir la source

Prevent default for up and down keys

Daoud Clarke il y a 3 ans
Parent
commit
f754b38f71
1 fichiers modifiés avec 2 ajouts et 0 suppressions
  1. 2 0
      static/index.js

+ 2 - 0
static/index.js

@@ -36,8 +36,10 @@ window.onload = (event) => {
         console.log("Key press", e);
         if (e.key == 'ArrowDown') {
             selectNextItem();
+            e.preventDefault();
         } else if (e.key == 'ArrowUp') {
             selectPreviousItem();
+            e.preventDefault();
         } else if (e.key == 'Enter') {
 //            const form = document.getElementById('search-form');
 //            form.submit();