Skip to content

Commit 844ae51

Browse files
committed
rustdoc: Properly restore search input placeholder
1 parent d8810e3 commit 844ae51

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

src/librustdoc/html/static/js/search.js

+4-3
Original file line numberDiff line numberDiff line change
@@ -5317,9 +5317,10 @@ function registerSearchEvents() {
53175317
});
53185318

53195319
// @ts-expect-error
5320-
searchState.input.addEventListener("blur", () => {
5321-
// @ts-expect-error
5322-
searchState.input.placeholder = searchState.input.origPlaceholder;
5320+
window.searchState.input.addEventListener("blur", () => {
5321+
if (window.searchState.input) {
5322+
window.searchState.input.placeholder = window.searchState.origPlaceholder;
5323+
}
53235324
});
53245325

53255326
// Push and pop states are used to add search results to the browser

0 commit comments

Comments
 (0)