chore: close toc-popup gracefully with Esc key (#1990)

This commit is contained in:
Alexander Fuks 2024-10-13 21:16:25 +04:00 committed by GitHub
parent 8a064a5e5a
commit 03e302cbf6
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -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;
} }