Closing dialogs with Esc should close and detach the dialog
authorAlexander Ebert <ebert@woltlab.com>
Wed, 19 Jul 2023 14:18:01 +0000 (16:18 +0200)
committerAlexander Ebert <ebert@woltlab.com>
Wed, 19 Jul 2023 14:18:01 +0000 (16:18 +0200)
See https://www.woltlab.com/community/thread/300742-seite-nicht-mehr-scrollbar-wenn-dialog-mittels-esc-geschlossen-wird/

ts/WoltLabSuite/Core/Element/woltlab-core-dialog.ts
wcfsetup/install/files/js/WoltLabSuite/Core/Element/woltlab-core-dialog.js

index aaa1b4ac5af0887d1a9cec5b92166cabd5747c9c..39aceafb26dcf49bae110495f4963c87d5130c13 100644 (file)
@@ -277,6 +277,8 @@ export class WoltlabCoreDialogElement extends HTMLElement {
         event.preventDefault();
         return;
       }
+
+      this.#detachDialog();
     });
 
     // Close the dialog by clicking on the backdrop.
index 618d373e8be7b4984407453816301da19665b8b0..c8b024a24e7487c33ce7b05d6150029986503453 100644 (file)
@@ -211,6 +211,7 @@ define(["require", "exports", "tslib", "../Dom/Util", "../Helper/PageOverlay", "
                     event.preventDefault();
                     return;
                 }
+                this.#detachDialog();
             });
             // Close the dialog by clicking on the backdrop.
             //