about summary refs log tree commit diff
path: root/src
diff options
context:
space:
mode:
authorGuillaume Gomez <guillaume1.gomez@gmail.com>2021-01-25 12:54:25 +0100
committerGuillaume Gomez <guillaume1.gomez@gmail.com>2021-01-25 12:54:25 +0100
commitef3127dcdfedb6b3b113150f6c84171bd98ab360 (patch)
treed4c8c8e7732ee8a7ba5a93c63d4a0c06f87eb30e /src
parent72c7b7026742766998655eba95fca984046c0288 (diff)
downloadrust-ef3127dcdfedb6b3b113150f6c84171bd98ab360.tar.gz
rust-ef3127dcdfedb6b3b113150f6c84171bd98ab360.zip
Completely remove search query parameter when clearing search input
Diffstat (limited to 'src')
-rw-r--r--src/librustdoc/html/static/main.js3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/librustdoc/html/static/main.js b/src/librustdoc/html/static/main.js
index 74bd348e9ac..5606a1d5170 100644
--- a/src/librustdoc/html/static/main.js
+++ b/src/librustdoc/html/static/main.js
@@ -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 {