Material: <md-menu> shrinks on iOS safari

Created on 21 Jan 2016  路  12Comments  路  Source: angular/material

If an md-menu is opened when iOS safari is in "minimal UI" mode (after scrolling down), it will shrink to a tiny size. Example:

md-menu-bug

This doesn't affect the demo site since the behavior is prevented by restricting overflow scrolling to a div, rather than the body element.

urgent Pull Request

Most helpful comment

My current workaround for this is just disabling the scaling animation when on Safari mobile:

// Detect mobile safari
var ua = window.navigator.userAgent,
iOS = !!ua.match(/iPad/i) || !!ua.match(/iPhone/i),
webkit = !!ua.match(/WebKit/i),
iOSSafari = iOS && webkit && !ua.match(/CriOS/i);
if (iOSSafari) {
    $('body').addClass('safari-mobile');
}
/* Disable transformation */
.safari-mobile .md-open-menu-container.md-active {
    transform: none !important;
}

All 12 comments

+1

@robertmesserle - can you review and test this?

Just came across this one. +1

This issue doesn't just occur in iOS safari, also happens in Chromium (Crosswalk). Might be related to touch devices

And that pull request didn't work for me

Just wan't to pin this here.

  • The fix works as expected in my case.

@jpike88 said its not working, because he missed copying all lines. (See here)

+1

So, is this fixed? What was the PR?

My current workaround for this is just disabling the scaling animation when on Safari mobile:

// Detect mobile safari
var ua = window.navigator.userAgent,
iOS = !!ua.match(/iPad/i) || !!ua.match(/iPhone/i),
webkit = !!ua.match(/WebKit/i),
iOSSafari = iOS && webkit && !ua.match(/CriOS/i);
if (iOSSafari) {
    $('body').addClass('safari-mobile');
}
/* Disable transformation */
.safari-mobile .md-open-menu-container.md-active {
    transform: none !important;
}

Some news to fix this ?

Agreed, I'd like to see this get fixed as well.

The solution from @herophuong works well. It'd be nice to have an official fix soon, though.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

chriseyhorn picture chriseyhorn  路  3Comments

ghost picture ghost  路  3Comments

kasajian picture kasajian  路  3Comments

rdantonio picture rdantonio  路  3Comments

ddimitrop picture ddimitrop  路  3Comments