rustdoc: fix "?" keyboard command when radio button is focused

This extends the special case with checkbox settings to also cover radios.
This commit is contained in:
Michael Howell
2023-01-18 11:52:31 -07:00
parent deb05758c8
commit bb5fb53b30
2 changed files with 12 additions and 1 deletions
+2 -1
View File
@@ -390,7 +390,8 @@ function loadCss(cssUrl) {
}
if (document.activeElement.tagName === "INPUT" &&
document.activeElement.type !== "checkbox") {
document.activeElement.type !== "checkbox" &&
document.activeElement.type !== "radio") {
switch (getVirtualKey(ev)) {
case "Escape":
handleEscape(ev);
+10
View File
@@ -212,6 +212,16 @@ press-key: "?"
wait-for-css: ("#settings-menu .popover", {"display": "none"})
wait-for-css: ("#help-button .popover", {"display": "block"})
// Now switch back to the settings popover, and make sure the keyboard
// shortcut works when a check box is selected.
click: "#settings-menu > a"
wait-for-css: ("#settings-menu .popover", {"display": "block"})
wait-for-css: ("#help-button .popover", {"display": "none"})
focus: "#theme-system-preference"
press-key: "?"
wait-for-css: ("#settings-menu .popover", {"display": "none"})
wait-for-css: ("#help-button .popover", {"display": "block"})
// Now we go to the settings page to check that the CSS is loaded as expected.
goto: "file://" + |DOC_PATH| + "/settings.html"
wait-for: "#settings"