Defocus search bar in rustdoc pages
Escape now removes focus from the search bar
This commit is contained in:
@@ -258,6 +258,7 @@
|
||||
addClass(search, "hidden");
|
||||
removeClass(document.getElementById("main"), "hidden");
|
||||
}
|
||||
defocusSearchBar();
|
||||
break;
|
||||
|
||||
case "s":
|
||||
@@ -1884,3 +1885,8 @@
|
||||
function focusSearchBar() {
|
||||
document.getElementsByClassName('search-input')[0].focus();
|
||||
}
|
||||
|
||||
// Removes the focus from the search bar
|
||||
function defocusSearchBar() {
|
||||
document.getElementsByClassName('search-input')[0].blur();
|
||||
}
|
||||
Reference in New Issue
Block a user