Skip to content

Commit

Permalink
chore: close toc-popup gracefully with Esc key (#1990)
Browse files Browse the repository at this point in the history
  • Loading branch information
kungfux authored Oct 13, 2024
1 parent 8a064a5 commit 03e302c
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion _javascript/modules/components/toc/toc-mobile.js
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,11 @@ export class TocMobile {
activeItem.scrollIntoView({ block: 'center' });
}

static hidePopup() {
static hidePopup(event) {
if (event?.type === 'cancel') {
event.preventDefault();
}

if (!$popup.open) {
return;
}
Expand Down

0 comments on commit 03e302c

Please sign in to comment.