mirror of
https://github.com/roc-lang/roc.git
synced 2025-11-01 21:40:58 +00:00
Merge pull request #4267 from lukewilliamboswell/main
roc docs add feature to focus search box using ⌘F, CTRL F, or F3
This commit is contained in:
commit
04bceae956
1 changed files with 17 additions and 0 deletions
|
|
@ -44,4 +44,21 @@
|
|||
searchBox.addEventListener("input", search);
|
||||
|
||||
search();
|
||||
|
||||
// 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