mirror of
https://github.com/nunocoracao/blowfish.git
synced 2025-02-02 03:22:33 -06:00
💖 Handle Enter key in search
This commit is contained in:
parent
5cae118d74
commit
4c41435a11
1 changed files with 15 additions and 0 deletions
|
@ -63,6 +63,21 @@ document.addEventListener("keydown", function (event) {
|
|||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Enter to get to results
|
||||
if (event.key == "Enter") {
|
||||
if (searchVisible && hasResults) {
|
||||
event.preventDefault();
|
||||
if (document.activeElement == input) {
|
||||
first.focus();
|
||||
} else {
|
||||
document.activeElement.click();
|
||||
}
|
||||
}else{
|
||||
event.preventDefault();
|
||||
}
|
||||
}
|
||||
|
||||
});
|
||||
|
||||
// Update search on each keypress
|
||||
|
|
Loading…
Reference in a new issue