diff --git a/src/librustdoc/html/static/js/main.js b/src/librustdoc/html/static/js/main.js index 940b62be0c9..ee7d19634b4 100644 --- a/src/librustdoc/html/static/js/main.js +++ b/src/librustdoc/html/static/js/main.js @@ -462,6 +462,7 @@ function preLoadCss(cssUrl) { case "s": case "S": + case "/": ev.preventDefault(); searchState.focus(); break; @@ -1334,7 +1335,7 @@ function preLoadCss(cssUrl) { const shortcuts = [ ["?", "Show this help dialog"], - ["S", "Focus the search field"], + ["S / /", "Focus the search field"], ["↑", "Move up in search results"], ["↓", "Move down in search results"], ["← / →", "Switch result tab (when results focused)"], diff --git a/src/librustdoc/html/templates/page.html b/src/librustdoc/html/templates/page.html index 1dc9041658e..1e01cd70b96 100644 --- a/src/librustdoc/html/templates/page.html +++ b/src/librustdoc/html/templates/page.html @@ -129,7 +129,7 @@ aria-label="Run search in the documentation" {#+ #} autocomplete="off" {#+ #} spellcheck="false" {#+ #} - placeholder="Click or press ‘S’ to search, ‘?’ for more options…" {#+ #} + placeholder="Type ‘S’ or ‘/’ to search, ‘?’ for more options…" {#+ #} type="search"> {# #}
{# #} ? {# #}