From 2ceeb590f3b19c625a8b4077c7764c420c20ee58 Mon Sep 17 00:00:00 2001 From: Alexander Ebert Date: Wed, 19 Jul 2023 16:18:01 +0200 Subject: [PATCH] Closing dialogs with Esc should close and detach the dialog 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 | 2 ++ .../files/js/WoltLabSuite/Core/Element/woltlab-core-dialog.js | 1 + 2 files changed, 3 insertions(+) diff --git a/ts/WoltLabSuite/Core/Element/woltlab-core-dialog.ts b/ts/WoltLabSuite/Core/Element/woltlab-core-dialog.ts index aaa1b4ac5a..39aceafb26 100644 --- a/ts/WoltLabSuite/Core/Element/woltlab-core-dialog.ts +++ b/ts/WoltLabSuite/Core/Element/woltlab-core-dialog.ts @@ -277,6 +277,8 @@ export class WoltlabCoreDialogElement extends HTMLElement { event.preventDefault(); return; } + + this.#detachDialog(); }); // Close the dialog by clicking on the backdrop. diff --git a/wcfsetup/install/files/js/WoltLabSuite/Core/Element/woltlab-core-dialog.js b/wcfsetup/install/files/js/WoltLabSuite/Core/Element/woltlab-core-dialog.js index 618d373e8b..c8b024a24e 100644 --- a/wcfsetup/install/files/js/WoltLabSuite/Core/Element/woltlab-core-dialog.js +++ b/wcfsetup/install/files/js/WoltLabSuite/Core/Element/woltlab-core-dialog.js @@ -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. // -- 2.20.1