mirror of
https://github.com/nunocoracao/blowfish.git
synced 2026-01-30 16:31:52 +01:00
💖 Handle Enter key in search
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user