mirror of
https://github.com/roc-lang/roc.git
synced 2025-07-23 06:25:10 +00:00
fix for 's' keypress in search, and escape behaviour to reset sidebar elements
This commit is contained in:
parent
34f56371f7
commit
17aac69d92
1 changed files with 7 additions and 1 deletions
|
@ -47,7 +47,7 @@
|
|||
|
||||
// Capture '/' keypress for quick search
|
||||
window.addEventListener("keyup", (e) => {
|
||||
if (e.key === "s") {
|
||||
if (e.key === "s" && document.activeElement !== searchBox) {
|
||||
e.preventDefault;
|
||||
searchBox.focus();
|
||||
searchBox.value = "";
|
||||
|
@ -55,7 +55,13 @@
|
|||
|
||||
if (e.key === "Escape" && document.activeElement === searchBox) {
|
||||
e.preventDefault;
|
||||
|
||||
// De-focus input box
|
||||
searchBox.blur();
|
||||
|
||||
// Reset sidebar state
|
||||
search();
|
||||
|
||||
}
|
||||
});
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue