Skip to content

Commit c512cf2

Browse files
authored
feat(modal): unsupported debug warning when useflex is used in ie or 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
1 parent 03e9d7f commit c512cf2

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

src/definitions/modules/modal.js

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -708,7 +708,15 @@ $.fn.modal = function(parameters) {
708708
return module.cache.leftBodyScrollbar;
709709
},
710710
useFlex: function() {
711-
return settings.useFlex && settings.detachable && !module.is.ie();
711+
if (settings.useFlex === 'auto') {
712+
return settings.detachable && !module.is.ie();
713+
}
714+
if(settings.useFlex && module.is.ie()) {
715+
module.debug('useFlex true is not supported in IE');
716+
} else if(settings.useFlex && !settings.detachable) {
717+
module.debug('useFlex true in combination with detachable false is not supported');
718+
}
719+
return settings.useFlex;
712720
},
713721
fit: function() {
714722
var

0 commit comments

Comments
 (0)