Skip to content

Commit

Permalink
rustdoc: make keyboard commands work when checkboxes are selected
Browse files Browse the repository at this point in the history
  • Loading branch information
notriddle committed Jun 29, 2022
1 parent cb8a738 commit f5f42a8
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/librustdoc/html/static/js/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
1 change: 1 addition & 0 deletions src/test/rustdoc-gui/settings.goml
Original file line number Diff line number Diff line change
Expand Up @@ -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"})

Expand Down

0 comments on commit f5f42a8

Please sign in to comment.