When you render the source for your side nav (.side-nav) inside the "normal" navbar, especially a fixed navbar (.navbar-fixed), the #sidenav-overlay covers the whole page including the actual sidenav. This makes the side nav not usable.
The issue occurs, because the .side-nav is embedded in .navbar-fixed. So the .navbar-fixed and #sidebar-overlay have the same z-index (997).
Any chance to fix the issue? Or is it required to place the sidebar outside of (any) .navbar?
View the pen below.
Update: seems to work on 0.97.7. Just set the codepen JS and CSS file to 0.97.7 to confirm.
I am seeing this issue on the latest version as well.
@MacGyer You have already given almost fix.
Just add this to your custom styles.css file :
.navbar-fixed {
z-index: 9999;
}
I check this in your given Codepen link and this worked fine.
@shmshd12 I just checked the pen. It is configured for 0.97.8 and your suggestion is integrated.
Does not work.
@MacGyer check this out : http://codepen.io/anon/pen/GrRrVP
This codepen is a copy paste of your given Codepen with addition of .navbar-fixed { z-index: 9999; }.
Check if your styles.css is below materialize.min.css. If it is at topstyles.css will not overwrite materialize.min.css file.
@shmshd12 sorry, my bad. Your solution indeed works. (had the CSS comment not closed).
Thanks for providing. Nevertheless I think, this issue should be solved by the Materialize CSS itself.
I got the same issue with my github pages,this should be solved by materialize itself not overwrite it!
@c0u1d Above given fix is a temporary one. Yes, this issue will not be closed until Materialize fix the issue.
If you adjust the z-index in .sidenav-overlay on /sass/components/_sideNav.scss line 208 from 997 to 996 then it will permanently resolve this issue.
I figured out the issue. It is because you have your sidebar nested within your .navbar-fixed. Moving the ul outside of the .navbar-fixed fixes the issue.
Here is the fixed pen: http://codepen.io/anon/pen/NdYjMy
As said @risendev I'm using
.navbar-fixed{
z-index:998;
}
It works fine as an exception.
@tomscholz It doesn't work. The menu doesn't hide after a click. My solution works as expected.
These issues are all duplicates:
https://github.com/Dogfalo/materialize/issues/1664
https://github.com/Dogfalo/materialize/issues/3918
https://github.com/Dogfalo/materialize/issues/4046
https://github.com/Dogfalo/materialize/issues/4231
https://github.com/Dogfalo/materialize/issues/437
https://github.com/Dogfalo/materialize/issues/4318
https://github.com/Dogfalo/materialize/issues/3982
https://github.com/Dogfalo/materialize/issues/2879
https://github.com/Dogfalo/materialize/issues/4187
For the future discussion, please use this issue instead.
https://github.com/Dogfalo/materialize/issues/3844
it took me 3 hours but i fixed it putting the slide-out
Most helpful comment
@MacGyer You have already given almost fix.
Just add this to your custom styles.css file :
.navbar-fixed { z-index: 9999; }I check this in your given Codepen link and this worked fine.