Prevent default for up and down keys
This commit is contained in:
parent
8f8fc43c9f
commit
f754b38f71
1 changed files with 2 additions and 0 deletions
|
@ -36,8 +36,10 @@ window.onload = (event) => {
|
||||||
console.log("Key press", e);
|
console.log("Key press", e);
|
||||||
if (e.key == 'ArrowDown') {
|
if (e.key == 'ArrowDown') {
|
||||||
selectNextItem();
|
selectNextItem();
|
||||||
|
e.preventDefault();
|
||||||
} else if (e.key == 'ArrowUp') {
|
} else if (e.key == 'ArrowUp') {
|
||||||
selectPreviousItem();
|
selectPreviousItem();
|
||||||
|
e.preventDefault();
|
||||||
} else if (e.key == 'Enter') {
|
} else if (e.key == 'Enter') {
|
||||||
// const form = document.getElementById('search-form');
|
// const form = document.getElementById('search-form');
|
||||||
// form.submit();
|
// form.submit();
|
||||||
|
|
Loading…
Reference in a new issue