Skip to content

Commit

Permalink
fix(modal): remove active class on hide
Browse files Browse the repository at this point in the history
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
lubber-de authored Jan 26, 2023

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
1 parent bdc9edd commit 27c5d2f
Showing 2 changed files with 2 additions and 1 deletion.
1 change: 1 addition & 0 deletions src/definitions/modules/modal.js
Original file line number Diff line number Diff line change
@@ -673,6 +673,7 @@
},
onComplete: function () {
module.unbind.scrollLock();
module.remove.active();
if (settings.allowMultiple) {
$previousModal.addClass(className.front);
$module.removeClass(className.front);
2 changes: 1 addition & 1 deletion src/definitions/modules/transition.js
Original file line number Diff line number Diff line change
@@ -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 {

0 comments on commit 27c5d2f

Please sign in to comment.