From eb2bb9902141e228549c30f39d99f11e0cff4ee4 Mon Sep 17 00:00:00 2001 From: asrar Date: Sat, 29 Aug 2020 10:19:58 +0000 Subject: [PATCH] GH-66816: Process before enabling search --- src/librustdoc/html/static/main.js | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/librustdoc/html/static/main.js b/src/librustdoc/html/static/main.js index 1dea27e7491..8fffcff59d5 100644 --- a/src/librustdoc/html/static/main.js +++ b/src/librustdoc/html/static/main.js @@ -2739,14 +2739,17 @@ function defocusSearchBar() { }); } - window.addSearchOptions = function(crates) { + function enableSearchInput() { if (search_input) { search_input.removeAttribute('disabled'); } + } + window.addSearchOptions = function(crates) { var elem = document.getElementById("crate-search"); if (!elem) { + enableSearchInput(); return; } var crates_text = []; @@ -2784,7 +2787,7 @@ function defocusSearchBar() { elem.value = savedCrate; } } - + enableSearchInput(); }; function buildHelperPopup() {