From ef3127dcdfedb6b3b113150f6c84171bd98ab360 Mon Sep 17 00:00:00 2001 From: Guillaume Gomez Date: Mon, 25 Jan 2021 12:54:25 +0100 Subject: [PATCH] Completely remove search query parameter when clearing search input --- src/librustdoc/html/static/main.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) 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 {