Completely remove search query parameter when clearing search input

This commit is contained in:
Guillaume Gomez 2021-01-25 12:54:25 +01:00
parent 72c7b70267
commit ef3127dcdf

View File

@ -1925,7 +1925,8 @@ function defocusSearchBar() {
clearInputTimeout();
if (search_input.value.length === 0) {
if (browserSupportsHistoryApi()) {
history.replaceState("", window.currentCrate + " - Rust", "?search=");
history.replaceState("", window.currentCrate + " - Rust",
window.location.href.split("?")[0]);
}
hideSearchResults();
} else {