Layout system does not work with Safari.
Commit: e2148f1
User Agents
Mozilla/5.0 (iPhone; CPU iPhone OS 10_9_5 like Mac OS X) AppleWebKit/600.1.4 (KHTML, like Gecko) Version/8.0 Mobile/12B411 Safari/600.1.4
Mozilla/5.0 (Macintosh; Intel Mac OS X 10_9_5) AppleWebKit/600.3.18 (KHTML, like Gecko) Version/7.1.3 Safari/537.85.12
Reproducing
- Create a container with three items and layout attributes
layout="row" layout-wrap. - Each item should include the
flexattribute and amin-width: 320pxCSS declaration. - View the page with Safari on iOS (I used 8.x on both a real and simulated iPhone 6) or OS X.
Actual Results
The items do not wrap as expected. See the screenshot below, in which it is clear that the items are still laid out left-to-right rather than stacked top-to-bottom as expected for layout-wrap at this viewport width. I suspect this has something to do with the way that autoprefixer is configured – i.e., contrary to claims that recent Safari versions (starting with 7 on iOS) implement the final version of the flexbox layout specification, Safari is not 100% compatible and angular-material.css is missing the vendor prefixes required by Safari’s actual implementation.

Expected Results
The items stack top-to-bottom as expected on Android Chrome.

It looks like Safari does not use min-width to calculate flex-basis. In order to work around this issue, we need to override the flex-basis imparted by the [flex] { flex: 1; } declaration (which uses the shorthand and assigns flex-basis: auto by default). Our declaration must use !important or be more specific:
.item {
...
}
[flex].item {
-webkit-flex-basis: 318px;
flex-basis: 318px;
}
See this CodePen.
I have opened problem ID 20009174 with Apple.
probably even i'm facing same problem with safari 5.1.7 on windows 7 desktop. the same problem is with android 4.0(using cordova app) also.
even angular-material site is not able to use flexbox on safari.(safari is on left, chrome is on right)

this is where i'm implementing.

@milanart Safari for windows hasn't been updated in years. I don't really think it's a goal to support it anymore.
@rschmukler - Can you look into this today?
@epelc i know, but its not just about safari 5.1.7. but the problem is same for android 4.3 and older(with cordova). hardly few windows users use safari. but there are lots of people with android 4.3- devices.
after going through following links i was able to fix most of the flex related problems, https://css-tricks.com/old-flexbox-and-new-flexbox/ http://stackoverflow.com/questions/17156444/flexbox-layout-does-not-work-in-internet-explorer-10 https://css-tricks.com/using-flexbox/
the problem I found is there is no fix added in css
flex-direction: column; // this line is given in material.css
//these 2 lines both should be added to fix for older version
-webkit-box-direction: normal;
-webkit-box-orient: vertical;
there are many fixes needed for various flex properties, after fixing some of by myself i was able to achieve the following. (uploaded here http://pastebin.com/n7McpS35)
still, i'm not able to solve width for flexbox.

@milanart - This looks very helpful. Thank you.
I also updated an issue already opened with WebKit: https://bugs.webkit.org/show_bug.cgi?id=136041
@milanart I didn't realize it was also a problem on mobile. Sorry about this.
Angular material targets android 4.4+. 4.2/4.3 only represent ~2% of web traffic according to caniuse. The safari bug is very interesting, but, out of our control. Closing.
dont take it wrong but, angular material website has used css fallbacks for safari. but not provided the same in material repo. I request you to please go though my comments above . Also, may i know how much web traffic is from android 4.4?
I think the issue also happened on IOS6 which uses mobile safari 5 because it only support old flex syntax
Using 0.8.3 and it is still not resolved. I am not able to use the flex="x" attribute.
@SiddharthaRRamesh - please retry with latest for /angular/material/#master
@ThomasBurleson Yeah I did try it, still no success! The same markup works fine on chrome but not on IOS 4, 5, 6 and 6+
Here is my markup:
<div layout="row" layout-align="space-around center" layout-sm="column">
<div flex="20">
<img ng-src=" " hide-sm hide-md flex="20" />
</div>
<div flex="40">
<md-card style="min-height:370px;"></md-card>
</div>
<div flex="40">
<md-card style="min-height:370px;"></md-card>
</div>
</div>
i am new to angular material i have one problem with responsive.. in mobile also it's showing desktop version of website. i tried every thing.. but when i resize the chrome window it's working but on actuall mobile screen....plzz help
Sorry, but I don't see why this task is closed. iPhone 4s is still relevant. iPhone 5 the same. Wheather for people who are using cordova or for classic browser usage.
The main problem is that the new flexsystem is not supported and there aren't any polyfills.
So, will there be a solution to make the layout system working in iPhone 4s?
@lukavent on a framework level we do not support browsers that old. I will discuss with the team to see whether it is worth compiling against the old standard as a small effort. That being said, I imagine there will be plenty of other issues besides just the layout that we will not support on the older versions. None the less, we can revisit whether it is worth including the old flex standard as an easy win.
add meta tag
On Thu, Sep 17, 2015 at 6:38 PM, Pierre Paul Lefebvre < [email protected]> wrote:
I'm having the same issue on safari 8 and all iPhone versions I got access to. Any idea if it's going to be fixed or if there is a flag/easy fix to apply?
— Reply to this email directly or view it on GitHub https://github.com/angular/material/issues/1720#issuecomment-141077126.