Fix the handling of non dialogs inside the dialog container
authorAlexander Ebert <ebert@woltlab.com>
Thu, 17 Aug 2023 16:59:50 +0000 (18:59 +0200)
committerAlexander Ebert <ebert@woltlab.com>
Thu, 17 Aug 2023 16:59:50 +0000 (18:59 +0200)
See #5627

ts/WoltLabSuite/Core/Ui/Dialog.ts
wcfsetup/install/files/js/WoltLabSuite/Core/Ui/Dialog.js

index c1596460e9a67776a757c33aea8cec62b7ce572b..ace02fe8d2c3e05b26127ed2d93375f81268f944 100644 (file)
@@ -808,7 +808,7 @@ const UiDialog = {
     _activeDialog = null;
     for (let i = 0; i < _container.childElementCount; i++) {
       const child = _container.children[i] as HTMLElement;
-      if (!Core.stringToBool(child.getAttribute("aria-hidden"))) {
+      if (child.classList.contains("dialogContainer") && !Core.stringToBool(child.getAttribute("aria-hidden"))) {
         _activeDialog = child.dataset.id || "";
         break;
       }
index 071603ae1476e3ded2dbe67ed873f5b5dedac501..c481bd3c2a324757d3acbd585148fc18dc82af87 100644 (file)
@@ -664,7 +664,7 @@ define(["require", "exports", "tslib", "../Core", "../Dom/Change/Listener", "./S
             _activeDialog = null;
             for (let i = 0; i < _container.childElementCount; i++) {
                 const child = _container.children[i];
-                if (!Core.stringToBool(child.getAttribute("aria-hidden"))) {
+                if (child.classList.contains("dialogContainer") && !Core.stringToBool(child.getAttribute("aria-hidden"))) {
                     _activeDialog = child.dataset.id || "";
                     break;
                 }