about summary refs log tree commit diff
path: root/src/librustdoc
diff options
context:
space:
mode:
authorGuillaume Gomez <guillaume1.gomez@gmail.com>2021-06-22 12:06:09 +0200
committerGuillaume Gomez <guillaume1.gomez@gmail.com>2021-06-23 10:09:26 +0200
commitc4023c6ca31f80cb7fa3cbebc9f0095d5f649d53 (patch)
tree9eaa76d7a2978abd8bc98f040309ea486518c8bb /src/librustdoc
parent8cb207ae69700de3e782eec5cc9013c0987b2519 (diff)
Fix search filter update
Diffstat (limited to 'src/librustdoc')
-rw-r--r--src/librustdoc/html/static/search.js4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/librustdoc/html/static/search.js b/src/librustdoc/html/static/search.js
index 35be246b5bf..617c79a4579 100644
--- a/src/librustdoc/html/static/search.js
+++ b/src/librustdoc/html/static/search.js
@@ -1442,6 +1442,10 @@ window.initSearch = function(rawSearchIndex) {
         if (selectCrate) {
             selectCrate.onchange = function() {
                 updateLocalStorage("rustdoc-saved-filter-crate", selectCrate.value);
+                // In case you "cut" the entry from the search input, then change the crate filter
+                // before paste back the previous search, you get the old search results without
+                // the filter. To prevent this, we need to remove the previous results.
+                currentResults = null;
                 search(undefined, true);
             };
         }