Skip to content

Commit

Permalink
Merge pull request #14932 from AUTOMATIC1111/fix/esc-interrupt
Browse files Browse the repository at this point in the history
Only trigger interrupt on `Esc` when interrupt button visible
  • Loading branch information
AUTOMATIC1111 committed Feb 17, 2024
2 parents ce57a6c + 46988af commit d235aa0
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions script.js
Original file line number Diff line number Diff line change
Expand Up @@ -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();
}
}
}
});
Expand Down

0 comments on commit d235aa0

Please sign in to comment.