I enjoy using flexbox but for some reason I cannot get wrapping to work on any iOS device. Is there an easy fallback for wrapping? Here's an issue where items just won't wrap: ( JSFiddle Fans )
#flex {display: flex; flex-flow: row wrap;}
#flex .item {width:33.33%; min-width: 500px; min-height: 300px;}
#flex .one {background: blue;}
#flex .two {background: green;}
#flex .three {background: red;}
<div id="flex">
<div class="item one"></div>
<div class="item two"></div>
<div class="item three"></div>
</div>
That's the simplest approach. I then tried to add a ton of prefixes to everything to see if that helped but it did not:
display: -webkit-box;
display: -moz-box;
display: -ms-flexbox;
display: -webkit-flex;
display: flex;
-webkit-flex: 0 1 auto;
-webkit-flex-flow: row wrap;
-ms-flex-flow: row wrap;
flex-flow: row wrap;
flex-wrap: wrap;
-webkit-flex-wrap: wrap;
Is the only solution to not use flexbox if I want things to wrap correctly on iphones?
The core of the issue was persistent in iPhone 5 and 6 through all browsers. In the end it had to do with setting a percentage width. Once I removed that everything stacked as it should. I wanna thank /u/andrei-gheorghiu as his JSFiddles ( in a deleted answer ) pointed me in the right direction.
#flex {
display: -webkit-box;
display: -webkit-flex;
display: -ms-flexbox;
display: flex;
-webkit-box-orient: horizontal;
-webkit-box-direction: normal;
-webkit-flex-direction: row;
-ms-flex-direction: row;
flex-direction: row;
-webkit-flex-wrap: wrap;
-ms-flex-wrap: wrap;
flex-wrap: wrap;
}
#flex .item {min-width: 200px; min-height: 300px;}
#flex .one {background: blue;}
#flex .two {background: green;}
#flex .three {background: red;}
<div id="flex">
<div class="item one"></div>
<div class="item two"></div>
<div class="item three"></div>
</div>
iPhone 6s not support flex-direction
tag.
I solved the problem by replacing it with flex-wrap
.
Old: flex-direction: column-reverse
New: flex-wrap: wrap-reverse
It's work!)
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With