diff options
| author | Guillaume Gomez <guillaume1.gomez@gmail.com> | 2018-01-05 01:14:10 +0100 |
|---|---|---|
| committer | Guillaume Gomez <guillaume1.gomez@gmail.com> | 2018-01-05 01:14:10 +0100 |
| commit | eea860f84c9338fbd89c1afe0aedd2c344aa6476 (patch) | |
| tree | a47b011e1975349a325769ebd70288c202093e2c | |
| parent | 8e7a609e635b728eba65d471c985ab462dc4cfc7 (diff) | |
| download | rust-eea860f84c9338fbd89c1afe0aedd2c344aa6476.tar.gz rust-eea860f84c9338fbd89c1afe0aedd2c344aa6476.zip | |
Fix search bar defocus
| -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'); } |
