Commit 46988af6 authored by catboxanon's avatar catboxanon

Fix `Esc` interrupt when button not visible

parent b7f45e67
...@@ -167,8 +167,10 @@ document.addEventListener('keydown', function(e) { ...@@ -167,8 +167,10 @@ document.addEventListener('keydown', function(e) {
const lightboxModal = document.querySelector('#lightboxModal'); const lightboxModal = document.querySelector('#lightboxModal');
if (!globalPopup || globalPopup.style.display === 'none') { if (!globalPopup || globalPopup.style.display === 'none') {
if (document.activeElement === lightboxModal) return; if (document.activeElement === lightboxModal) return;
interruptButton.click(); if (interruptButton.style.display !== 'none') {
e.preventDefault(); interruptButton.click();
e.preventDefault();
}
} }
} }
}); });
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment