Skip to content

Commit fdc39cd

Browse files
committed
Rollup merge of rust-lang#27094 - tamird:DRY-search-focus, r=brson
Following up on comment from rust-lang#26977. r? @brson
2 parents 99987a8 + b3a9cd3 commit fdc39cd

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/librustdoc/html/static/main.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -115,7 +115,7 @@
115115
case "s":
116116
case "S":
117117
ev.preventDefault();
118-
$(".search-input").focus();
118+
focusSearchBar()
119119
break;
120120

121121
case "?":
@@ -960,5 +960,5 @@
960960

961961
// Sets the focus on the search bar at the top of the page
962962
function focusSearchBar() {
963-
document.getElementsByName('search')[0].focus();
963+
$('.search-input').focus();
964964
}

0 commit comments

Comments
 (0)