[Modal] Return control over useflex again, but provide unsupported debug warning #1240
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description
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 assumesauto
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 thecan.useFlex
method but added some debug warnings instead when unsupported combinations occur, because the positioning foruseFlex:true
will not work when:detachable:false
is usedAs the default of
useFlex
isauto
, existing code should basically work as before without any visual issuesI am totally fine if @fomantic/maintainers will disagree and would like to reject this PR and keep the current implementation because
debug
setting of their modals in order to see the message telling them why the positioning seems to be brokenIf we reject this PR and keep the source as it is, we might change the docs, because
useFlex:true
will definately not work as intended and is currently always treated asauto
🗯 Let me know about your opinion
Testcase
Scroll down to see the button to open the moda
http://jsfiddle.net/9cf2o75b/
Screenshots
When
useFlex:true
is used in combination withIE

detachable: false
