You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
(sidenav) elements with position: fixed inside md-sidenav-layout #998
Because of transform: translate3d(0, 0, 0) on md-sidenav-layout any element with position: fixed inside it will act as if it had position: absolute or static instead. It's an expected behaviour, but it's annoying nevertheless.
Could we either remove that transform from md-sidenav-layout(it's only there because of performance I suppose), or add more examples to Portal and mention it as a workaround in docs, since portal could probably solve this by basically putting the element that needs to be fixed next to the md-sidenav-layout in the dom tree.
Reacted by Petro Salema, Juan J. Jimenez-Anca, Brady Sterling, Nir Galon, Elia Palme, Georgii Glinskij, Edric Chan, Vitaly Tkachenko, Michael Prentice, Jake Anderson and 22 more
changed the title [-](sidenav) fixed elements inside `md-sidenav-layout`[/-][+](sidenav) elements with `position: fixed` inside `md-sidenav-layout`[/+]on Aug 11, 2016
In my opinion this is a bug insofar as it is the equivalent of putting a ban on fixed elements. I am now trying to create a fab button on the bottom right corner of the screen. Because of this issue I'm unable to do so unless I use solution provided by @fxck
Reacted by bergben, Dmitry Kolupaev, Rene Vallecillo V, Nir Galon, András Szepesházi, Fredrik Lundin, Ed Pelc, Pascal Temel, Michael Prentice, Jake Anderson and 10 more
that's clever @mmalerba but it wouldn't work in my case. My button is inside a router outlet as the fab is not always needed. Your solution would work great for cases where fixed elements should be visible in every view though.
Also, it would mean a lot of boilerplate to pass events to other components within the scrollable area
@cortopy
It was kinda late yesterday, the problem was that I simply forgot to import the Directive as well 😄
Got some other problem now though that the sidebar is not opening / visible / whatever...
What I got now is this:
Still couldn't resolve this. Seems like this wasn't a problem with the angular 1 version of the sidenav...
Problem is, I don't only have one button that is fixed but the whole content is fixed for a certain time as I am using https://github.com/bergben/ng2-scrollimate to apply animations on the fly during scroll. So if I displace that all then there is nothing left anymore in md-sidenav-content and the sidenav itself doesn't work anymore...
Activity
[-]fixed elements inside `md-sidenav-layout`[/-][+](sidenav) fixed elements inside `md-sidenav-layout`[/+][-](sidenav) fixed elements inside `md-sidenav-layout`[/-][+](sidenav) elements with `position: fixed` inside `md-sidenav-layout`[/+]fxck commentedon Sep 1, 2016
https://gist.github.com/fxck/b668f7fec77d7b28d8c7ce6b706601f7
here's a component that takes whatever is inside it and puts it to the
bodyusing material2 overlayfxck commentedon Oct 5, 2016
@jelbourn this is still a thing, can you label it please?
jelbourn commentedon Oct 5, 2016
We need to discuss whether we consider this a bug or not.
cortopy commentedon Nov 4, 2016
In my opinion this is a bug insofar as it is the equivalent of putting a ban on fixed elements. I am now trying to create a fab button on the bottom right corner of the screen. Because of this issue I'm unable to do so unless I use solution provided by @fxck
bergben commentedon Nov 18, 2016
Is the workaround from @fxck still working?
I am getting
EXCEPTION: Must provide a portal to attach...mmalerba commentedon Nov 18, 2016
I recommend just absolutely positioning the fab outside the scrollable region: http://plnkr.co/edit/VItn3Y2AaTzpzIykTTyH?p=preview
cortopy commentedon Nov 18, 2016
that's clever @mmalerba but it wouldn't work in my case. My button is inside a router outlet as the fab is not always needed. Your solution would work great for cases where fixed elements should be visible in every view though.
Also, it would mean a lot of boilerplate to pass events to other components within the scrollable area
cortopy commentedon Nov 18, 2016
@bergben it is. I'm using material alpha 10 and it still works. It took me a bit to get it working though. Could you post what you have?
bergben commentedon Nov 18, 2016
@cortopy
It was kinda late yesterday, the problem was that I simply forgot to import the Directive as well 😄
Got some other problem now though that the sidebar is not opening / visible / whatever...
What I got now is this:
How exactly do I have to wrap the content with the displacer to get it to work?
I also had to add this css to make the fixed content work:
bergben commentedon Nov 22, 2016
Still couldn't resolve this. Seems like this wasn't a problem with the angular 1 version of the sidenav...
Problem is, I don't only have one button that is fixed but the whole content is fixed for a certain time as I am using https://github.com/bergben/ng2-scrollimate to apply animations on the fly during scroll. So if I displace that all then there is nothing left anymore in md-sidenav-content and the sidenav itself doesn't work anymore...
mmalerba commentedon Nov 22, 2016
#1966 adds a sidenav with fab example
27 remaining items
WaterBleu commentedon Sep 1, 2017
Im surprised we still have to do workaround at this point.
this is like a year old bug
CDDelta commentedon Sep 1, 2017
@WaterBleu see #6712
WaterBleu commentedon Sep 1, 2017
@CDDelta nice! now just have to wait for the approval
MatthewS2077 commentedon Sep 5, 2017
@CDDelta Excellent!
mackelito commentedon Sep 5, 2017
aaaah maaaaan.. just I did this like 3 weeks ago! 😆
But still.. Great work 👊 😄
karser commentedon Sep 19, 2017
Great that it'll be fixed soon.
Meanwhile after updating to 2.0.0-beta.10:
sijithc40 commentedon Oct 9, 2017
I given this
.mat-sidenav-content,
.mat-sidenav-container,
.mat-drawer-content {
transform: none !important;
}
But side-nav "push" is not working now
mina-skunk commentedon Oct 9, 2017
@sijithc40 It won't because "push" mode uses
transform.Sangeethaself commentedon Nov 20, 2017
Material design light with version v1.0.1
After long searching and trying , problem solved by following code
.mat-sidenav-container,
md-sidenav-container div[style],
.mat-sidenav-content{
transform: none !important;
-webkit-transform: none !important;
}
rahulasharm commentedon Nov 28, 2017
I am using angular 2, so what should I do for this issue.....
cybergaala commentedon Mar 21, 2018
Simply define width margin at mat-sidenav-content in styles.css file:
angular-automatic-lock-bot commentedon Sep 8, 2019
This issue has been automatically locked due to inactivity.
Please file a new issue if you are encountering a similar or related problem.
Read more about our automatic conversation locking policy.
This action has been performed automatically by a bot.