mirror of
https://github.com/roc-lang/roc.git
synced 2025-08-04 04:08:19 +00:00
updated quick search keyboard shortct in docs to / key, included escape out of input box
This commit is contained in:
parent
c01611ca9a
commit
2b47a4067b
1 changed files with 13 additions and 4 deletions
|
@ -45,11 +45,20 @@
|
|||
|
||||
search();
|
||||
|
||||
window.addEventListener("keydown", (e) => {
|
||||
if (e.code === 'F3' || ((e.ctrlKey || e.metaKey) && e.code === 'KeyF')) {
|
||||
e.preventDefault();
|
||||
// Capture '/' keypress for quick search
|
||||
window.addEventListener("keyup", (e) => {
|
||||
|
||||
if (e.code === "Slash") {
|
||||
e.preventDefault;
|
||||
searchBox.focus();
|
||||
searchBox.value = "";
|
||||
}
|
||||
|
||||
if (e.code === "Escape" && document.activeElement === searchBox) {
|
||||
e.preventDefault;
|
||||
searchBox.blur();
|
||||
}
|
||||
|
||||
});
|
||||
|
||||
|
||||
})();
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue