We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 2aa9e4a commit 0c774cfCopy full SHA for 0c774cf
static/search.js
@@ -2,6 +2,7 @@ const MAX_ITEMS = 10;
2
const UP_ARROW = "ArrowUp";
3
const DOWN_ARROW = "ArrowDown";
4
const ENTER_KEY = "Enter";
5
+const ESCAPE_KEY = "Escape";
6
7
const searchInput = document.getElementById("search");
8
const searchResults = document.getElementById("search-results");
@@ -41,6 +42,14 @@ document.addEventListener("keydown", function (keyboardEvent) {
41
42
if (target) target.click();
43
break;
44
}
45
+
46
+ case ESCAPE_KEY: {
47
+ searchInput.value = "";
48
+ searchResults.style.display = "none";
49
+ searchInput.blur();
50
+ break;
51
+ }
52
53
54
});
55
0 commit comments