diff options
| author | Guillaume Gomez <guillaume1.gomez@gmail.com> | 2020-08-24 12:59:16 +0200 |
|---|---|---|
| committer | Guillaume Gomez <guillaume1.gomez@gmail.com> | 2020-08-24 12:59:16 +0200 |
| commit | 76bd5b3852d39e624999e6f3dd16cd2b02657333 (patch) | |
| tree | e7b82e3fff5a8efd932faaa63072de8addc366b6 | |
| parent | 6cb364cda47d960d08b8e7fb03d0df0e9bdbd190 (diff) | |
Add explanations on the results search element check
| -rw-r--r-- | src/librustdoc/html/static/main.js | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/src/librustdoc/html/static/main.js b/src/librustdoc/html/static/main.js index f465228b749..57c8d5bff76 100644 --- a/src/librustdoc/html/static/main.js +++ b/src/librustdoc/html/static/main.js @@ -1579,6 +1579,9 @@ function defocusSearchBar() { var search = getSearchElement(); if (results.others.length === 1 && getCurrentValue("rustdoc-go-to-only-result") === "true" + // By default, the search DOM element is "empty" (meaning it has no children not + // text content). Once a search has been run, it won't be empty, even if you press + // ESC or empty the search input (which also "cancels" the search). && (!search.firstChild || search.firstChild.innerText !== getSearchLoadingText())) { var elem = document.createElement("a"); |
