modal.js: Do not wobble if ESC has been handled otherwise
Some checks failed
L10n Update / update (push) Has been cancelled
CI / PHP (push) Has been cancelled

This commit is contained in:
Johannes Meyer 2026-05-21 14:54:39 +02:00
parent 40114d90e4
commit 21ef5900ab

View file

@ -208,7 +208,7 @@
* @param event {KeyboardEvent} The `keydown` event triggered by pushing a key
*/
Modal.prototype.onEscapeKey = function(event) {
if (event.key !== 'Escape') {
if (event.isDefaultPrevented() || event.key !== 'Escape') {
return;
}
@ -220,7 +220,7 @@
if (_this.hasChanges) {
_this.wobble($modal);
} else if (! event.isDefaultPrevented()) {
} else {
_this.hide($modal);
}
};