mirror of
https://github.com/nunocoracao/blowfish.git
synced 2025-04-21 04:51:53 +02:00
Merge pull request #1120 from nunocoracao/1104-handle-enter-key-in-search
💖 Handle Enter key in search
This commit is contained in:
commit
88731e553b
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…
Add table
Reference in a new issue