diff options
| author | Guillaume Gomez <guillaume1.gomez@gmail.com> | 2018-01-06 02:13:35 +0100 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2018-01-06 02:13:35 +0100 |
| commit | b3104178d6ebeb2244e3e502b98a142ebcc6030b (patch) | |
| tree | 0edf1ff5861cc7bd77dc7363eab41b49c738ef8d | |
| parent | 21b9822390323420ae3a2998f1c376606325a883 (diff) | |
| parent | eea860f84c9338fbd89c1afe0aedd2c344aa6476 (diff) | |
| download | rust-b3104178d6ebeb2244e3e502b98a142ebcc6030b.tar.gz rust-b3104178d6ebeb2244e3e502b98a142ebcc6030b.zip | |
Rollup merge of #47202 - GuillaumeGomez:fix-defocus, r=QuietMisdreavus
Fix search bar defocus Fixes #47134. r? @QuietMisdreavus
| -rw-r--r-- | src/librustdoc/html/static/main.js | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/src/librustdoc/html/static/main.js b/src/librustdoc/html/static/main.js index c128a812b93..b4dbd76d0b4 100644 --- a/src/librustdoc/html/static/main.js +++ b/src/librustdoc/html/static/main.js @@ -1132,6 +1132,10 @@ e.preventDefault(); } else if (e.which === 16) { // shift // Does nothing, it's just to avoid losing "focus" on the highlighted element. + } else if (e.which === 27) { // escape + removeClass(actives[currentTab][0], 'highlighted'); + document.getElementsByClassName('search-input')[0].value = ''; + defocusSearchBar(); } else if (actives[currentTab].length > 0) { removeClass(actives[currentTab][0], 'highlighted'); } |
