about summary refs log tree commit diff
path: root/src/librustdoc/html/static
diff options
context:
space:
mode:
authorCarol (Nichols || Goulding) <carol.nichols@gmail.com>2020-06-01 22:21:39 -0400
committerCarol (Nichols || Goulding) <carol.nichols@gmail.com>2020-06-03 21:09:55 -0400
commite85df08bdec792f512c1f92dbdb126c49ac57d0c (patch)
tree58de39c6bd731db0b1fb8962ef13e10c22c39027 /src/librustdoc/html/static
parentf3fadf6abd571868d70538561a0731ddd800003a (diff)
downloadrust-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.js2
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 =