From: louismaxime.piton Date: Fri, 30 Jun 2023 12:40:36 +0000 (+0200) Subject: Fix X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=b17e3b174bd04ac9e3c6aa5f07ba7911a26398eb;p=thirdparty%2Fbootstrap.git Fix --- diff --git a/js/src/modal.js b/js/src/modal.js index b44cbb94d9..33e525d235 100644 --- a/js/src/modal.js +++ b/js/src/modal.js @@ -139,13 +139,17 @@ class Modal extends BaseComponent { } dispose() { - EventHandler.off(window, EVENT_KEY) - EventHandler.off(this._dialog, EVENT_KEY) + this._element.addEventListener(EVENT_HIDDEN, () => { + EventHandler.off(window, EVENT_KEY) + EventHandler.off(this._dialog, EVENT_KEY) - this._backdrop.dispose() - this._focustrap.deactivate() + this._backdrop.dispose() + this._focustrap.deactivate() + + super.dispose() + }) - super.dispose() + this._hideModal() } handleUpdate() {