Skip to content

Commit f5f42a8

Browse files
committed
rustdoc: make keyboard commands work when checkboxes are selected
1 parent cb8a738 commit f5f42a8

File tree

2 files changed

+3
-1
lines changed

2 files changed

+3
-1
lines changed

src/librustdoc/html/static/js/main.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -419,7 +419,8 @@ function loadCss(cssFileName) {
419419
return;
420420
}
421421

422-
if (document.activeElement.tagName === "INPUT") {
422+
if (document.activeElement.tagName === "INPUT" &&
423+
document.activeElement.type !== "checkbox") {
423424
switch (getVirtualKey(ev)) {
424425
case "Escape":
425426
handleEscape(ev);

src/test/rustdoc-gui/settings.goml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -122,6 +122,7 @@ click: ".setting-line:last-child .toggle .label"
122122
assert-local-storage: {"rustdoc-disable-shortcuts": "true"}
123123

124124
// Make sure that "Disable keyboard shortcuts" actually took effect.
125+
// The help popover won't exist yet.
125126
press-key: "?"
126127
wait-for-css: ("#settings-menu .popover", {"display": "block"})
127128

0 commit comments

Comments
 (0)