From 29e1112d3afde9719597e27bb8b7fc0057b863fd Mon Sep 17 00:00:00 2001 From: Johannes Meyer Date: Thu, 21 May 2026 14:54:39 +0200 Subject: [PATCH] modal.js: Do not wobble if ESC has been handled otherwise --- public/js/icinga/behavior/modal.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/public/js/icinga/behavior/modal.js b/public/js/icinga/behavior/modal.js index 1d29b9c972..ab20408945 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); } };