diff --git a/core/dom/dom.ui.js b/core/dom/dom.ui.js index 6f4ecde54a..139c90dca8 100644 --- a/core/dom/dom.ui.js +++ b/core/dom/dom.ui.js @@ -1580,7 +1580,8 @@ var jeeDialog = (function() { this.dialog.unseen() this.dialog._jeeDialog.options.onClose() this.dialog.removeClass('active') - document.querySelectorAll('div.jeeDialog.jeeDialogMain:not([style*="display: none;"])')[0]?.addClass('active') + let _dialog = document.querySelectorAll('div.jeeDialog.jeeDialogMain:not([style*="display: none;"])') + _dialog[_dialog.length - 1]?.addClass('active') cleanBackdrop() }, destroy: function() { diff --git a/desktop/common/js/utils.js b/desktop/common/js/utils.js index 62cc700688..a04c55868b 100644 --- a/desktop/common/js/utils.js +++ b/desktop/common/js/utils.js @@ -879,9 +879,10 @@ jeedomUtils.setJeedomGlobalUI = function() { event.target.value = '' return } - else + else if (event.target.matches('body')) { //close active modal document.querySelector('div.jeeDialog.active')?._jeeDialog.close() + } } })