Completely remove search query parameter when clearing search input
This commit is contained in:
parent
72c7b70267
commit
ef3127dcdf
1 changed files with 2 additions and 1 deletions
|
@ -1925,7 +1925,8 @@ function defocusSearchBar() {
|
||||||
clearInputTimeout();
|
clearInputTimeout();
|
||||||
if (search_input.value.length === 0) {
|
if (search_input.value.length === 0) {
|
||||||
if (browserSupportsHistoryApi()) {
|
if (browserSupportsHistoryApi()) {
|
||||||
history.replaceState("", window.currentCrate + " - Rust", "?search=");
|
history.replaceState("", window.currentCrate + " - Rust",
|
||||||
|
window.location.href.split("?")[0]);
|
||||||
}
|
}
|
||||||
hideSearchResults();
|
hideSearchResults();
|
||||||
} else {
|
} else {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue