Improve focus on reload, back, etc
This commit is contained in:
parent
202ef35d7a
commit
8f8fc43c9f
1 changed files with 7 additions and 3 deletions
|
@ -39,17 +39,21 @@ window.onload = (event) => {
|
|||
} else if (e.key == 'ArrowUp') {
|
||||
selectPreviousItem();
|
||||
} else if (e.key == 'Enter') {
|
||||
clickSelected();
|
||||
}
|
||||
// const form = document.getElementById('search-form');
|
||||
// form.submit();
|
||||
// event.preventDefault();
|
||||
}
|
||||
});
|
||||
|
||||
// Handle pressing enter
|
||||
const form = document.getElementById('search-form');
|
||||
|
||||
form.addEventListener( "submit", event => {
|
||||
form.addEventListener("submit", event => {
|
||||
event.preventDefault();
|
||||
clickSelected();
|
||||
});
|
||||
|
||||
searchInput.focus();
|
||||
};
|
||||
|
||||
|
||||
|
|
Loading…
Reference in a new issue