Fix form builder dialogs left defunct when clicking the X button
authorAlexander Ebert <ebert@woltlab.com>
Thu, 23 Nov 2023 11:43:08 +0000 (12:43 +0100)
committerAlexander Ebert <ebert@woltlab.com>
Thu, 23 Nov 2023 11:43:08 +0000 (12:43 +0100)
See https://www.woltlab.com/community/thread/302346-the-create-album-button-does-not-work-after-closing-the-dialog/

ts/WoltLabSuite/Core/Component/FormBuilder/Setup.ts
wcfsetup/install/files/js/WoltLabSuite/Core/Component/FormBuilder/Setup.js

index c47f1682d1f6306eddcb22bd793aec1d9e5453cd..6339c813f77a7b6ba538a69861bca3ea29183aa6 100644 (file)
@@ -75,7 +75,7 @@ export class FormBuilderSetup {
         event.detail.push(validationCallback);
       });
 
-      dialog.addEventListener("cancel", () => {
+      dialog.addEventListener("afterClose", () => {
         if (FormBuilderManager.hasForm(json.formId)) {
           FormBuilderManager.unregisterForm(json.formId);
         }
index 9329026ae4ed806e119a6050c7077b6b9cccbc19..15089ff4dcbda23156ddf48ec170c2aa996768a5 100644 (file)
@@ -45,7 +45,7 @@ define(["require", "exports", "tslib", "../../Ajax/Backend", "../../Dom/Util", "
                     });
                     event.detail.push(validationCallback);
                 });
-                dialog.addEventListener("cancel", () => {
+                dialog.addEventListener("afterClose", () => {
                     if (FormBuilderManager.hasForm(json.formId)) {
                         FormBuilderManager.unregisterForm(json.formId);
                     }