소스 검색

Prevent default for up and down keys

Daoud Clarke 3 년 전
부모
커밋
f754b38f71
1개의 변경된 파일2개의 추가작업 그리고 0개의 파일을 삭제
  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();