diff --git a/public/js/icinga/behavior/modal.js b/public/js/icinga/behavior/modal.js index 1d29b9c97..ab2040894 100644 --- a/public/js/icinga/behavior/modal.js +++ b/public/js/icinga/behavior/modal.js @@ -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); } };