Fix `Esc` interrupt when button not visible

This commit is contained in:
catboxanon 2024-02-15 13:05:39 -05:00
parent b7f45e67dc
commit 46988af636
1 changed files with 4 additions and 2 deletions

View File

@ -167,10 +167,12 @@ document.addEventListener('keydown', function(e) {
const lightboxModal = document.querySelector('#lightboxModal');
if (!globalPopup || globalPopup.style.display === 'none') {
if (document.activeElement === lightboxModal) return;
if (interruptButton.style.display !== 'none') {
interruptButton.click();
e.preventDefault();
}
}
}
});
/**