diff options
| author | Carol (Nichols || Goulding) <carol.nichols@gmail.com> | 2020-06-01 22:21:39 -0400 |
|---|---|---|
| committer | Carol (Nichols || Goulding) <carol.nichols@gmail.com> | 2020-06-03 21:09:55 -0400 |
| commit | e85df08bdec792f512c1f92dbdb126c49ac57d0c (patch) | |
| tree | 58de39c6bd731db0b1fb8962ef13e10c22c39027 /src/librustdoc/html/static | |
| parent | f3fadf6abd571868d70538561a0731ddd800003a (diff) | |
| download | rust-e85df08bdec792f512c1f92dbdb126c49ac57d0c.tar.gz rust-e85df08bdec792f512c1f92dbdb126c49ac57d0c.zip | |
Don't move cursor in search box when using arrows to navigate search results
Diffstat (limited to 'src/librustdoc/html/static')
| -rw-r--r-- | src/librustdoc/html/static/main.js | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/src/librustdoc/html/static/main.js b/src/librustdoc/html/static/main.js index ac5a2f96b26..1611c91e559 100644 --- a/src/librustdoc/html/static/main.js +++ b/src/librustdoc/html/static/main.js @@ -1396,6 +1396,7 @@ function defocusSearchBar() { addClass(actives[currentTab][0].previousElementSibling, "highlighted"); removeClass(actives[currentTab][0], "highlighted"); + e.preventDefault(); } else if (e.which === 40) { // down if (!actives[currentTab].length) { var results = document.getElementById("results").childNodes; @@ -1409,6 +1410,7 @@ function defocusSearchBar() { addClass(actives[currentTab][0].nextElementSibling, "highlighted"); removeClass(actives[currentTab][0], "highlighted"); } + e.preventDefault(); } else if (e.which === 13) { // return if (actives[currentTab].length) { document.location.href = |
