rustdoc: make keyboard commands work when checkboxes are selected

This commit is contained in:
Michael Howell 2022-06-28 15:06:48 -07:00
parent cb8a7388fa
commit f5f42a8cba
2 changed files with 3 additions and 1 deletions

View File

@ -419,7 +419,8 @@ function loadCss(cssFileName) {
return;
}
if (document.activeElement.tagName === "INPUT") {
if (document.activeElement.tagName === "INPUT" &&
document.activeElement.type !== "checkbox") {
switch (getVirtualKey(ev)) {
case "Escape":
handleEscape(ev);

View File

@ -122,6 +122,7 @@ click: ".setting-line:last-child .toggle .label"
assert-local-storage: {"rustdoc-disable-shortcuts": "true"}
// Make sure that "Disable keyboard shortcuts" actually took effect.
// The help popover won't exist yet.
press-key: "?"
wait-for-css: ("#settings-menu .popover", {"display": "block"})