Skip to content

Commit

Permalink
Don't move cursor in search box when using arrows to navigate search …
Browse files Browse the repository at this point in the history
…results
  • Loading branch information
carols10cents committed Jun 4, 2020
1 parent f3fadf6 commit e85df08
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/librustdoc/html/static/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -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 =
Expand Down

0 comments on commit e85df08

Please sign in to comment.