Flexbox wraps last column of the first row in Safari
Explanation
This happens because Safari treats :before and :after pseudo-elements as if they were real elements. E.g. think about a container with 7 items. If container has :before and :after Safari will position the items like this:
[:before ] [1st-item] [2nd-item]
[3rd-item] [4th-item] [5th-item]
[6th-item] [7th-item] [:after ]
Solution
As an alternative to the accepted answer I remove :before & :after from flex containers instead of altering the HTML. In your case:
.flexthis.container:before,
.flexthis.container:after,
.flexthis.row:before,
.flexthis.row:after {
content: normal; // IE doesn't support `initial`
}
Just to update on my question
This is the solution I go with, this is obviously fixed for Bootstrap4, which is flexbox compatible. So this is only for bootstrap3.
.row.flexthis:after, .row.flexthis:before{
display: none;
}
I know the issue is quite old, but I ran into this issue today, and wasted over 12 hours in fixing it. Though about 10 hours out of that were spent in realizing that safari is failing with 12-column bootstrap grid, and it is no other issue.
Fix that I made is rather simple. Here is the version for Visual Composer. Class names may vary for other frameworks.
.vc_row-flex:before, .vc_row-flex:after{
width: 0;
}
I didn't want to add more classes to fix this kind of bug, so alternatively you can fix the .row class itself.
.row {
&:before {
content: none;
}
&:after {
content: '';
}
}
Found this issue trying to do a simple grid using Bootstrap for the TwentyThree CMS, and got the same bug in Safari. Anyway, this solved it for me:
.flex-container:before {
display: inline;
}