From 46988af63696a232cbf94cdeaca6de32cc56e23c Mon Sep 17 00:00:00 2001 From: catboxanon <122327233+catboxanon@users.noreply.github.com> Date: Thu, 15 Feb 2024 13:05:39 -0500 Subject: [PATCH] Fix `Esc` interrupt when button not visible --- script.js | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/script.js b/script.js index be1bc317e..25cf0973a 100644 --- a/script.js +++ b/script.js @@ -167,8 +167,10 @@ document.addEventListener('keydown', function(e) { const lightboxModal = document.querySelector('#lightboxModal'); if (!globalPopup || globalPopup.style.display === 'none') { if (document.activeElement === lightboxModal) return; - interruptButton.click(); - e.preventDefault(); + if (interruptButton.style.display !== 'none') { + interruptButton.click(); + e.preventDefault(); + } } } });