From 7349862f45892a5ab7447779ee54810c10ec2398 Mon Sep 17 00:00:00 2001 From: Dustin Hibbard Date: Tue, 30 Aug 2022 14:34:43 -0500 Subject: [PATCH 1/2] When hiding a modal, check for other modals and hide the dimmer on animation complete instead of animation start. --- src/definitions/modules/modal.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/definitions/modules/modal.js b/src/definitions/modules/modal.js index 6904359fbf..d00e2f2ddf 100755 --- a/src/definitions/modules/modal.js +++ b/src/definitions/modules/modal.js @@ -611,9 +611,6 @@ $.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(); } @@ -631,6 +628,9 @@ $.fn.modal = function(parameters) { $previousModal.find(selector.dimmer).removeClass('active'); } } + if(!module.others.active() && !module.others.animating() && !keepDimmed) { + module.hideDimmer(); + } if($.isFunction(settings.onHidden)) { settings.onHidden.call(element); } From db5450d11a9737c13478ffd41b59c7bf3f017694 Mon Sep 17 00:00:00 2001 From: Dustin Hibbard Date: Tue, 30 Aug 2022 16:38:49 -0500 Subject: [PATCH 2/2] Revert to hide dimmer check on animation start. When hiding an allowMultiple modal, also do dimmer check on hide animation complete. --- src/definitions/modules/modal.js | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/src/definitions/modules/modal.js b/src/definitions/modules/modal.js index d00e2f2ddf..a7b437f950 100755 --- a/src/definitions/modules/modal.js +++ b/src/definitions/modules/modal.js @@ -614,6 +614,9 @@ $.fn.modal = function(parameters) { if( settings.keyboardShortcuts && !module.others.active() ) { module.remove.keyboardShortcuts(); } + if(!module.others.active() && !module.others.animating() && !keepDimmed) { + module.hideDimmer(); + } }, onComplete : function() { module.unbind.scrollLock(); @@ -627,9 +630,9 @@ $.fn.modal = function(parameters) { else { $previousModal.find(selector.dimmer).removeClass('active'); } - } - if(!module.others.active() && !module.others.animating() && !keepDimmed) { - module.hideDimmer(); + if(!module.others.active() && !module.others.animating() && !keepDimmed) { + module.hideDimmer(); + } } if($.isFunction(settings.onHidden)) { settings.onHidden.call(element);