Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(modal): Hiding dimmer with multiple modals #2444

Draft
wants to merge 2 commits into
base: develop
Choose a base branch
from
Draft
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 6 additions & 3 deletions src/definitions/modules/modal.js
Original file line number Diff line number Diff line change
Expand Up @@ -611,12 +611,12 @@ $.fn.modal = function(parameters) {
duration : settings.transition.hideDuration || settings.duration,
useFailSafe : true,
onStart : function() {
if(!module.others.active() && !module.others.animating() && !keepDimmed) {
module.hideDimmer();
}
if( settings.keyboardShortcuts && !module.others.active() ) {
module.remove.keyboardShortcuts();
}
if(!module.others.active() && !module.others.animating() && !keepDimmed) {
module.hideDimmer();
}
Comment on lines +617 to +619
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could you please move this code where it was before (at the top of onStart), so this does not become an unnecessary change ? (Yes, logical wise it does not matter, but let's reduce changes to the minimum where needed 🙂 (also keeps the git history more clean)

},
onComplete : function() {
module.unbind.scrollLock();
Expand All @@ -630,6 +630,9 @@ $.fn.modal = function(parameters) {
else {
$previousModal.find(selector.dimmer).removeClass('active');
}
if(!module.others.active() && !module.others.animating() && !keepDimmed) {
module.hideDimmer();
}
}
if($.isFunction(settings.onHidden)) {
settings.onHidden.call(element);
Expand Down