Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 11 additions & 1 deletion crates/mdbook-html/front-end/js/book.js
Original file line number Diff line number Diff line change
Expand Up @@ -706,11 +706,21 @@ aria-label="Show hidden lines"></button>';

// Usually needs the Shift key to be pressed
switch (e.key) {
case '?':
case '?': {
const active = document.activeElement;
if (active &&
(
active.tagName === 'INPUT' ||
active.tagName === 'TEXTAREA' ||
active.isContentEditable
)) {
return;
}
e.preventDefault();
showHelp();
break;
}
}

// Rest of the keys are only active when the Shift key is not pressed
if (e.shiftKey) {
Expand Down