1
Fork 0

rustdoc: clean up redundant search hiding results code

* There's no need to call `history.replaceState` right before
    calling `searchState.hideResults`, which already does it.
  * There's no need to implement hiding search results when that
    is already implemented.
This commit is contained in:
Michael Howell 2023-04-21 15:07:52 -07:00
parent 9d69ee0574
commit 0cd3874155
2 changed files with 1 additions and 8 deletions

View file

@ -375,10 +375,7 @@ function preLoadCss(cssUrl) {
function handleEscape(ev) {
searchState.clearInputTimeout();
switchDisplayedElement(null);
if (browserSupportsHistoryApi()) {
history.replaceState(null, "", getNakedUrl() + window.location.hash);
}
searchState.hideResults();
ev.preventDefault();
searchState.defocus();
window.hideAllModals(true); // true = reset focus for tooltips