Prevent automatic page change when using history#75806
Prevent automatic page change when using history#75806bors merged 2 commits intorust-lang:masterfrom
Conversation
|
Some changes occurred in HTML/CSS/JS. |
|
(rust_highfive has picked a reviewer for you, use r? to override) |
src/librustdoc/html/static/main.js
Outdated
There was a problem hiding this comment.
Why not add this to the conditions above?
6b9e892 to
6cb364c
Compare
|
Updated! |
| var search = getSearchElement(); | ||
| if (results.others.length === 1 | ||
| && getCurrentValue("rustdoc-go-to-only-result") === "true" | ||
| && (!search.firstChild || search.firstChild.innerText !== getSearchLoadingText())) |
There was a problem hiding this comment.
In what cases will !search.firstChild happen?
There was a problem hiding this comment.
By default it's empty. So it's not empty when you already performed a search and "cancelled" it (meaning, you pressed ESC or remove all the content from the search input) or if there is the "loading search result" text when you arrive on the page with a search parameter in your URL.
There was a problem hiding this comment.
Does not look that straightforward to me but I understand after you explain.
There was a problem hiding this comment.
I'll add a comment then.
|
I added an explanation on the condition. |
pickfire
left a comment
There was a problem hiding this comment.
Good and even clearer now.
|
@bors: r=pickfire rollup |
|
📌 Commit 76bd5b3 has been approved by |
|
⌛ Testing commit 76bd5b3 with merge 24d88da65e150c0f13e82c5cd213fcb3da348207... |
|
The job Click to expand the log.I'm a bot! I can only do what humans tell me to, so if this was not helpful or you have suggestions for improvements, please ping or otherwise contact |
|
💔 Test failed - checks-actions |
|
clang failed? O.o Well, I guess it's out of the scope of this PR so let's retry... @bors: retry |
|
⌛ Testing commit 76bd5b3 with merge 1b33cf01a8507e618751d974a1cbbf831d903873... |
|
The job Click to expand the log.I'm a bot! I can only do what humans tell me to, so if this was not helpful or you have suggestions for improvements, please ping or otherwise contact |
|
cc @rust-lang/infra |
|
💔 Test failed - checks-actions |
|
We're already on it. Zulip discussion. @bors retry |
|
Oh great! Thanks for the quick answer. :) |
Rollup of 10 pull requests Successful merges: - rust-lang#74730 (Hexagon libstd: update type defs) - rust-lang#75758 (Fixes for VxWorks) - rust-lang#75780 (Unconfuse Unpin docs a bit) - rust-lang#75806 (Prevent automatic page change when using history) - rust-lang#75818 (Update docs for SystemTime Windows implementation) - rust-lang#75837 (Fix font color for help button in ayu and dark themes) - rust-lang#75870 (Unify theme choices border color in ayu theme) - rust-lang#75875 (Shorten liballoc vec resize intra-doc link) - rust-lang#75953 (Fix swapped stability attributes for rustdoc lints) - rust-lang#75958 (Avoid function-scoping global variables) Failed merges: r? @ghost
Fixes #75774.