chore: close toc-popup gracefully with Esc key (#1990)
This commit is contained in:
parent
8a064a5e5a
commit
03e302cbf6
1 changed files with 5 additions and 1 deletions
|
@ -62,7 +62,11 @@ export class TocMobile {
|
||||||
activeItem.scrollIntoView({ block: 'center' });
|
activeItem.scrollIntoView({ block: 'center' });
|
||||||
}
|
}
|
||||||
|
|
||||||
static hidePopup() {
|
static hidePopup(event) {
|
||||||
|
if (event?.type === 'cancel') {
|
||||||
|
event.preventDefault();
|
||||||
|
}
|
||||||
|
|
||||||
if (!$popup.open) {
|
if (!$popup.open) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue