Skip to content

Commit c364dd9

Browse files
committed
rustdoc: work around button focus
1 parent cf1e854 commit c364dd9

File tree

1 file changed

+2
-0
lines changed
  • src/librustdoc/html/static/js

1 file changed

+2
-0
lines changed

src/librustdoc/html/static/js/main.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -312,6 +312,8 @@ function preLoadCss(cssUrl) {
312312
focus: () => {
313313
searchState.showResults();
314314
searchState.inputElement().focus();
315+
// Avoid glitch if something focuses the search button after clicking.
316+
requestAnimationFrame(() => searchState.inputElement().focus());
315317
},
316318
// Removes the focus from the search bar.
317319
defocus: () => {

0 commit comments

Comments
 (0)