Skip to content

Commit

Permalink
feat(modal): unsupported debug warning when useflex is used in ie or …
Browse files Browse the repository at this point in the history
…with detachable false

This PR gives full control over the useFlex setting again.
Some combinations are not working for correct positioning, which was basically fixed by #1079 and #1096
However, the fixes ignored a possible explicit given useFlex:true and always assumes auto instead (which makes sure the positioning will work all the time)
As it turned out here there are some usecases, where people need the explicit setting of useFlex:true, i reverted the logic for the can.useFlex method but added some debug warnings instead when unsupported combinations occur, because the positioning for useFlex:true will not work when:

- IE11 is used
- detachable:false is used
As the default of useFlex is auto, existing code should basically work as before without any visual issues
  • Loading branch information
lubber-de authored Feb 16, 2020
1 parent 03e9d7f commit c512cf2
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion src/definitions/modules/modal.js
Original file line number Diff line number Diff line change
Expand Up @@ -708,7 +708,15 @@ $.fn.modal = function(parameters) {
return module.cache.leftBodyScrollbar;
},
useFlex: function() {
return settings.useFlex && settings.detachable && !module.is.ie();
if (settings.useFlex === 'auto') {
return settings.detachable && !module.is.ie();
}
if(settings.useFlex && module.is.ie()) {
module.debug('useFlex true is not supported in IE');
} else if(settings.useFlex && !settings.detachable) {
module.debug('useFlex true in combination with detachable false is not supported');
}
return settings.useFlex;
},
fit: function() {
var
Expand Down

0 comments on commit c512cf2

Please sign in to comment.