mirror of
https://github.com/roc-lang/roc.git
synced 2025-09-29 06:44:46 +00:00
Search docs with S instead of /
It turns out / on Firefox is already search, and we don't want to override that. Also adds a tip to make the shortcut discoverable.
This commit is contained in:
parent
04bceae956
commit
34f56371f7
3 changed files with 11 additions and 7 deletions
|
@ -45,20 +45,18 @@
|
|||
|
||||
search();
|
||||
|
||||
// Capture '/' keypress for quick search
|
||||
// Capture '/' keypress for quick search
|
||||
window.addEventListener("keyup", (e) => {
|
||||
|
||||
if (e.code === "Slash") {
|
||||
if (e.key === "s") {
|
||||
e.preventDefault;
|
||||
searchBox.focus();
|
||||
searchBox.value = "";
|
||||
}
|
||||
|
||||
if (e.code === "Escape" && document.activeElement === searchBox) {
|
||||
if (e.key === "Escape" && document.activeElement === searchBox) {
|
||||
e.preventDefault;
|
||||
searchBox.blur();
|
||||
}
|
||||
|
||||
});
|
||||
|
||||
})();
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue