From 21ef5900abda23232108f8ea7192113548db4fd3 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 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); } };