material icon indicating copy to clipboard operation
material copied to clipboard

md-sidenav: md-is-locked-open="$media('gt-lg')" does not collapse on resize - Safari & Firefox

Open hodeyp opened this issue 11 years ago • 5 comments

When md-is-locked-open="$media('gt-lg')" is used to lock open the sidenav on larger displays it should automatically collapse on window resize to < lg. This works as expected on Chrome but does not work on Firefox or Safari.

hodeyp avatar Jan 29 '15 07:01 hodeyp

I'm seeing this too. Here's a fork of the Material Angular SideNav Demo Codepen that shows this behavior.

http://codepen.io/anon/pen/XJaqXv?editors=101

The sidenav doesn't show/hide in Firefox (v35.0.1 on linux is what I tested) when you resize the browser window. If you reload the page it works, just not on window resize. Also appears to be a general issue related to browser resize. I saw the same behavior with gt-md as well (so I guess I really didn't need to fork the codepen :\ ).

mzbyszynski avatar Jan 29 '15 16:01 mzbyszynski

@ajoslin any ideas on this?

rschmukler avatar Jan 29 '15 23:01 rschmukler

Could it be that matchMedia#addListener (as introduced in 8a0411f) isn't so widely/consistently supported ?

gkalpak avatar Jan 30 '15 07:01 gkalpak

According to caniuse.com, it is. Requires further testing.

ajoslin avatar Jan 30 '15 15:01 ajoslin

The issue was that only chrome as the query as the context set for this. All browsers pass it in as an argument

rschmukler avatar Feb 07 '15 20:02 rschmukler