From 27c5d2f1d0bcdca80718e659da7a82ad87731c6c Mon Sep 17 00:00:00 2001 From: Marco 'Lubber' Wienkoop Date: Thu, 26 Jan 2023 09:52:33 +0100 Subject: [PATCH] fix(modal): remove active class on hide Also remove the active class when a modal is hidden. This makes sure the modal doesnt keep an in between added active class if hide was called when the show transition has not already ended. The class is already removed at the start of the hiding process and it is still needed there because of CSS settings which will otherwise disturb the hide animation. This PR fixes such a specific use case --- src/definitions/modules/modal.js | 1 + src/definitions/modules/transition.js | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/src/definitions/modules/modal.js b/src/definitions/modules/modal.js index 3dc3f5e779..e30a34c6a5 100755 --- a/src/definitions/modules/modal.js +++ b/src/definitions/modules/modal.js @@ -673,6 +673,7 @@ }, onComplete: function () { module.unbind.scrollLock(); + module.remove.active(); if (settings.allowMultiple) { $previousModal.addClass(className.front); $module.removeClass(className.front); diff --git a/src/definitions/modules/transition.js b/src/definitions/modules/transition.js index 8e89f7c4de..06ad73479d 100644 --- a/src/definitions/modules/transition.js +++ b/src/definitions/modules/transition.js @@ -216,7 +216,7 @@ module.restore.conditions(); module.hide(); } else if (module.is.inward()) { - module.verbose('Animation is outward, showing element'); + module.verbose('Animation is inward, showing element'); module.restore.conditions(); module.show(); } else {