Skip to content

Commit 247e2e2

Browse files
Rollup merge of rust-lang#85509 - GuillaumeGomez:search-null-title, r=jsha
Prevent tab title to "null" if the URL is a search one 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: ```js 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: ```js document.title = searchState.title; ``` But since it's `null`, we set it as title. This PR fixes it. r? `@jsha`
2 parents 0918348 + 222126a commit 247e2e2

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/librustdoc/html/static/main.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -161,7 +161,7 @@ function hideThemeButtonState() {
161161
outputElement: function() {
162162
return document.getElementById("search");
163163
},
164-
title: null,
164+
title: document.title,
165165
titleBeforeSearch: document.title,
166166
timeout: null,
167167
// On the search screen, so you remain on the last tab you opened.

0 commit comments

Comments
 (0)