Skip to content

Commit 03e302c

Browse files
authored
chore: close toc-popup gracefully with Esc key (#1990)
1 parent 8a064a5 commit 03e302c

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

_javascript/modules/components/toc/toc-mobile.js

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,11 @@ export class TocMobile {
6262
activeItem.scrollIntoView({ block: 'center' });
6363
}
6464

65-
static hidePopup() {
65+
static hidePopup(event) {
66+
if (event?.type === 'cancel') {
67+
event.preventDefault();
68+
}
69+
6670
if (!$popup.open) {
6771
return;
6872
}

0 commit comments

Comments
 (0)