Skip to content

Commit cf36df9

Browse files
catboxanonruchej
authored andcommitted
Fix Esc interrupt when button not visible
1 parent d9002ff commit cf36df9

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

script.js

+4-2
Original file line numberDiff line numberDiff line change
@@ -167,8 +167,10 @@ document.addEventListener('keydown', function(e) {
167167
const lightboxModal = document.querySelector('#lightboxModal');
168168
if (!globalPopup || globalPopup.style.display === 'none') {
169169
if (document.activeElement === lightboxModal) return;
170-
interruptButton.click();
171-
e.preventDefault();
170+
if (interruptButton.style.display !== 'none') {
171+
interruptButton.click();
172+
e.preventDefault();
173+
}
172174
}
173175
}
174176
});

0 commit comments

Comments
 (0)