Skip to content

Commit

Permalink
Disable refreshing for non active/animated modals
Browse files Browse the repository at this point in the history
This commit solves #4196
When two or more modals coexist on the same page, the refresh method
of each modal is executed, even if one of them is being shown.
By checking if the module is active or being animated, you prevent
conflicts between shown and hidden modals, like the one described in
the issue.
  • Loading branch information
Pablo Molina committed Apr 26, 2017
1 parent 7d0621c commit 7a17e70
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/definitions/modules/modal.js
Original file line number Diff line number Diff line change
Expand Up @@ -290,7 +290,7 @@ $.fn.modal = function(parameters) {
}
},
resize: function() {
if( $dimmable.dimmer('is active') ) {
if( $dimmable.dimmer('is active') && ( module.is.animating() || module.is.active() ) ) {
requestAnimationFrame(module.refresh);
}
}
Expand Down

0 comments on commit 7a17e70

Please sign in to comment.