From 0210e69abcfa58d28fb2d8cf8a61b07682ab7d7f Mon Sep 17 00:00:00 2001 From: Eric Huss Date: Mon, 26 May 2025 10:58:53 -0700 Subject: [PATCH] Fix search hotkey https://github.com/rust-lang/mdBook/pull/2608 accidentally broke the search "S" keybinding by using the wrong capitalization. --- src/front-end/searcher/searcher.js | 2 +- tests/gui/search.goml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/front-end/searcher/searcher.js b/src/front-end/searcher/searcher.js index 6dca5965..3c03de20 100644 --- a/src/front-end/searcher/searcher.js +++ b/src/front-end/searcher/searcher.js @@ -356,7 +356,7 @@ window.search = window.search || {}; } showSearch(false); marker.unmark(); - } else if (!hasFocus() && (e.key === 'S' || e.key === '/')) { + } else if (!hasFocus() && (e.key === 's' || e.key === '/')) { e.preventDefault(); showSearch(true); window.scrollTo(0, 0); diff --git a/tests/gui/search.goml b/tests/gui/search.goml index dd362bd1..2c81590f 100644 --- a/tests/gui/search.goml +++ b/tests/gui/search.goml @@ -7,7 +7,7 @@ define-function: ( [], block { assert-css: ("#search-wrapper", {"display": "none"}) - press-key: 'S' + press-key: 's' wait-for-css-false: ("#search-wrapper", {"display": "none"}) } )