updated quick search keyboard shortct in docs to / key, included escape out of input box

This commit is contained in:
Luke Boswell 2022-10-09 17:56:28 +11:00
parent c01611ca9a
commit 2b47a4067b
No known key found for this signature in database
GPG key ID: 0E908525B2C7BD68

View file

@ -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();
}
});
})();