Uh oh!
There was an error while loading. Please reload this page.
Fix navbar click while in a search - #45812
Conversation
rust-highfive
commented
Nov 6, 2017
Some changes occurred in HTML/CSS. |
rust-highfive
commented
Nov 6, 2017
r? @frewsxcv (rust_highfive has picked a reviewer for you, use r? to override) |
QuietMisdreavus
commented
Nov 6, 2017
This does not fix the issue. The URL still swallows the |
57e0d15 to
3533b2aCompare3533b2a to
acd5e8cCompareQuietMisdreavus
commented
Nov 6, 2017
So with the current change, the search properly works, and clicking a link in the sidebar will properly dismiss the search, scroll to the desired heading, and toggle the heading's "active" highlight (giving it the yellow background). However, something strange happens: The window title is not changed back from "Results for (query)", and the URL will only say |
frewsxcv
commented
Nov 7, 2017
not too familiar with this code, so gonna reassign |
GuillaumeGomez
commented
Nov 10, 2017
Updated. |
QuietMisdreavus
commented
Nov 10, 2017
Is it possible to clear out the query parameters when setting the hash? The URL now properly has the hash, but it still has the query parameters, so now it has Also the title doesn't get set back when you click a sidebar link, so it still says "Results for sync" even though the search results were dismissed. |
There was a problem hiding this comment.
- Firefox ignores the title argument to
pushState/replaceStateanyway, so right now this is moot, but: - Setting this unilaterally to "std - Rust" is wildly inaccurate, even within libstd, because for anything but the crate root the title is set to the path of the item. But for anything but libstd, this is just erroneous.
On the other hand, with the empty search param, the link is now stable, and the search box and results are still the same. If we can't change the title (in Firefox, at least) via replaceState, then i'll just give up on it for the time being. I'd suggest either finding some other way to set it properly or just changing this back to "".
1157788 to
0d89899CompareQuietMisdreavus
commented
Nov 10, 2017
With the last force-push, i'm ready to call it. There's still the issue of the page title being wrong, but at this point i'm willing to cut my losses. r=me pending travis. |
QuietMisdreavus
commented
Nov 10, 2017
Actually, the JS doesn't affect any of the tests that i know of, and it passed tidy, so let's just move along. @bors r+ rollup |
bors
commented
Nov 10, 2017
📌 Commit 0d89899 has been approved by |
…QuietMisdreavus Fix navbar click while in a search Fixesrust-lang#45790.
Fixes#45790.