material icon indicating copy to clipboard operation
material copied to clipboard

mdSidenav: md-backdrop wrong place

Open ptrenery opened this issue 11 years ago • 2 comments

Created a md-toolbar above a md-sidenav so that the nav panel appears below the toolbar when it is locked open. That works fine.

In this configuration, when opening a sidenav that is not locked, it animates into place at the top of the screen, not below the toolbar which is also fine. However, the md-backdrop is created below the toolbar meaning you can still interact with the toolbar. In addition, the offset backdrop goes below the bottom of the page so a scrollbar appears and the page can now be scrolled down.

screen shot 2015-09-04 at 10 58 31 am

I added a simple md-toolbar to the standard sidenav codepen demo here that shows the issue. Click the "TOGGLE RIGHT" button then scroll down.

md-backdrop {top: 0} seems to fix it

ptrenery avatar May 26 '15 22:05 ptrenery

An alternative workaround (or perhaps intended approach?) is to trap the sidenav and content in their own div which you then set as position relative (or presumably whatever you like so long as it is explicit). The md-backdrop position:absolute then refers to that div rather than the browser window.

jhogg41 avatar May 30 '15 19:05 jhogg41

Please post this in the Angular Material Forum

ThomasBurleson avatar Sep 04 '15 15:09 ThomasBurleson