From e85df08bdec792f512c1f92dbdb126c49ac57d0c Mon Sep 17 00:00:00 2001 From: "Carol (Nichols || Goulding)" Date: Mon, 1 Jun 2020 22:21:39 -0400 Subject: [PATCH] Don't move cursor in search box when using arrows to navigate search results --- src/librustdoc/html/static/main.js | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/librustdoc/html/static/main.js b/src/librustdoc/html/static/main.js index ac5a2f96b26c6..1611c91e559bc 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 =