Skip to content

Conversation

GuillaumeGomez
Copy link
Member

When we arrive on page with a search parameter in the URL, until the results are displayed, the page title is "null". It's because of this code:

if (params.search !== undefined) {
    var search = searchState.outputElement();
    search.innerHTML = "<h3 style=\"text-align: center;\">" +
       searchState.loadingText + "</h3>";
    searchState.showResults(search);
    loadSearch();
}

In searchState.showResults, we have this:

document.title = searchState.title;

But since it's null, we set it as title. This PR fixes it.

r? @jsha

@GuillaumeGomez GuillaumeGomez added T-rustdoc Relevant to the rustdoc team, which will review and decide on the PR/issue. A-rustdoc-js Area: Rustdoc's JS front-end labels May 20, 2021
@rust-highfive
Copy link
Contributor

Some changes occurred in HTML/CSS/JS.

cc @GuillaumeGomez

@rust-highfive rust-highfive added the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label May 20, 2021
@jsha
Copy link
Contributor

jsha commented May 20, 2021

@bors r+

@bors
Copy link
Collaborator

bors commented May 20, 2021

📌 Commit 222126a has been approved by jsha

@bors bors added S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels May 20, 2021
@GuillaumeGomez
Copy link
Member Author

@bors: rollup

bors added a commit to rust-lang-ci/rust that referenced this pull request May 20, 2021
…laumeGomez

Rollup of 5 pull requests

Successful merges:

 - rust-lang#85275 (Move `std::memchr` to `sys_common`)
 - rust-lang#85326 (bootstrap: ensure host std when cross-compiling tools, fixes rust-lang#85320)
 - rust-lang#85375 (Fix missing lifetimes diagnostics after rust-lang#83759)
 - rust-lang#85507 (Extend escape key check)
 - rust-lang#85509 (Prevent tab title to "null" if the URL is a search one)

Failed merges:

r? `@ghost`
`@rustbot` modify labels: rollup
@bors bors merged commit 247e2e2 into rust-lang:master May 20, 2021
@rustbot rustbot added this to the 1.54.0 milestone May 20, 2021
@GuillaumeGomez GuillaumeGomez deleted the search-null-title branch May 20, 2021 21:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-rustdoc-js Area: Rustdoc's JS front-end S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. T-rustdoc Relevant to the rustdoc team, which will review and decide on the PR/issue.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants