Merge pull request #14932 from AUTOMATIC1111/fix/esc-interrupt

Only trigger interrupt on `Esc` when interrupt button visible
This commit is contained in:
AUTOMATIC1111 2024-02-17 08:57:25 +03:00 committed by GitHub
commit d235aa068d
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 4 additions and 2 deletions

View File

@ -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();
}
}
}
});