Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Sidenav always visible when nested elements use fullscreen. #7636

Open
Enngage opened this issue Oct 8, 2017 · 3 comments
Open

Sidenav always visible when nested elements use fullscreen. #7636

Enngage opened this issue Oct 8, 2017 · 3 comments
Labels
area: material/sidenav P3 An issue that is relevant to core functions, but does not impede progress. Important, but not urgent

Comments

@Enngage
Copy link

Enngage commented Oct 8, 2017

Bug/proposal

Hey guys,

I'm using the sidenav component which puts all content inside 'mat-sidenav-content' that contains sets z-index: 1;. This is causing an issue any nested components require fullscreen because the side navigation is always visible no matter what z-index I use. I expect this to be because the mat-sidenav-content has a priority over the child elements.

It ends up looking like this:

always_visible

What is the expected behavior?

I would like the ability for nested components to use fullscreen without manually hiding the sidenav.

Which versions of Angular, Material, OS, TypeScript, browsers are affected?

Using Angular material 2.0.0-beta.12 & Angular 4.4.4.

Is there anything else we should know?

It seems that setting z-index to -2 to .mat-drawer-content or .mat-drawer.mat-drawer-side classes fixes the issue, but I'm unsure as to any other side effects this might have. I have not seen any though.

After this change it looks as I would expect it to:

proper

@Enngage
Copy link
Author

Enngage commented Nov 17, 2017

I'm no front-end developer, but overriding these classes did the trick for me:

.mat-drawer.mat-drawer-side {
    z-index: 1!important;
}

.mat-drawer-content {
    z-index: auto!important;
}

.mat-drawer-container {
    z-index: auto!important;
}

So far it seems ok and I found no issues with this so far.

Tested on "@angular/material": "5.0.0-rc0"

@mmalerba
Copy link
Contributor

We introduced z-index as a way of creating a new stacking context since transform: translate3d(0,0,0) caused fixed position elements to behave like absolute ones. We can revisit and see if there's something else we can do, but for now overriding the z-index is the appropriate workaround.

@mmalerba mmalerba added the P3 An issue that is relevant to core functions, but does not impede progress. Important, but not urgent label Nov 21, 2017
@bvspkk
Copy link

bvspkk commented Oct 22, 2018

Hai , I am using as per above style sheet backdrop not appear to main component sidenav . Please help

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area: material/sidenav P3 An issue that is relevant to core functions, but does not impede progress. Important, but not urgent
4 participants