-
Notifications
You must be signed in to change notification settings - Fork 13.3k
rustdoc: Properly restore search input placeholder #137055
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
rustdoc: Properly restore search input placeholder #137055
Conversation
r? @notriddle rustbot has assigned @notriddle. Use |
Some changes occurred in HTML/CSS/JS. cc @GuillaumeGomez, @jsha |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
To clarify, the minimal fix would be:
searchState.input.addEventListener("blur", () => {
- searchState.input.placeholder = searchState.input.origPlaceholder;
+ searchState.input.placeholder = searchState.origPlaceholder;
});
844ae51
to
351cc1f
Compare
@bors r+ rollup |
…iaskrgr Rollup of 8 pull requests Successful merges: - rust-lang#127581 (Fix crate name validation) - rust-lang#136490 (Do not allow attributes on struct field rest patterns) - rust-lang#136808 (Try to recover from path sep error in type parsing) - rust-lang#137055 (rustdoc: Properly restore search input placeholder) - rust-lang#137068 (fix(rustdoc): Fixed `Copy Item Path` in rust doc) - rust-lang#137070 (Do not generate invalid links in job summaries) - rust-lang#137074 (compiletest: add `{ignore,only}-rustc_abi-x86-sse2` directives) - rust-lang#137076 (triagebot.toml: ping me on changes to `tests/rustdoc-json`) r? `@ghost` `@rustbot` modify labels: rollup
Could you also add a GUI test to prevent a regression please? :) |
Since this already being tested by bors in a rollup, I'd do that in a separate PR. Note tho that as long as we continue using TypeScript, this won't regress. |
Yeah it's fine in another PR. Don't hesitate if you need my help. ;) |
…iaskrgr Rollup of 8 pull requests Successful merges: - rust-lang#127581 (Fix crate name validation) - rust-lang#136490 (Do not allow attributes on struct field rest patterns) - rust-lang#136808 (Try to recover from path sep error in type parsing) - rust-lang#137055 (rustdoc: Properly restore search input placeholder) - rust-lang#137068 (fix(rustdoc): Fixed `Copy Item Path` in rust doc) - rust-lang#137070 (Do not generate invalid links in job summaries) - rust-lang#137074 (compiletest: add `{ignore,only}-rustc_abi-x86-sse2` directives) - rust-lang#137076 (triagebot.toml: ping me on changes to `tests/rustdoc-json`) r? `@ghost` `@rustbot` modify labels: rollup
Rollup merge of rust-lang#137055 - fmease:rustdoc-js-fix-input-placeholder-logic, r=notriddle rustdoc: Properly restore search input placeholder Fix the search input placeholder literally getting set to the string *undefined* on blur/defocus. This was caused by us trying to access an undefined property in the event listener. To prevent this from regressing again, stop typescript from ignoring the relevant site. Steps to reproduce the bug fixed in this PR: 1. Focus the search input field by clicking on it and clear the input if necessary 2. Blur/defocus it by clicking somewhere outside of it --- First bug that would've been caught by TSC if we had had it earlier! Type (quasi-)safety, ahoy! :)
Fix the search input placeholder literally getting set to the string undefined on blur/defocus.
This was caused by us trying to access an undefined property in the event listener.
To prevent this from regressing again, stop typescript from ignoring the relevant site.
Steps to reproduce the bug fixed in this PR:
First bug that would've been caught by TSC if we had had it earlier! Type (quasi-)safety, ahoy! :)