question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Sidenav and fixed elements

See original GitHub issue

Bug, feature request, or proposal:

Bug

What is the expected behavior?

fixed elements to be fixed without css tricks

What is the current behavior?

To keep elements fixed (such as toolbar on the top, floating buttons on on the bottom) I need to set height: 100% on html, body, main, and md-sidenav-container (and any other potential parents). I have to set overflow-y: auto on the md-sidenav-container too.

If any of those properties is omitted, then toolbar & floating buttons fixed property is now taken as absolute.

What are the steps to reproduce?

Just look this sample and try to fix the toolbar ; or jsut get an empty app with a sidenav and a toolbar. Unfortunately I can’t provide any plunker (proxy doesn’t allow it).

What is the use-case or motivation for changing an existing behavior?

It seems to be a misfunction of the component and not the actual expected behavior. Plus, those css tricks I mentioned cause side-effets, especially on scroll event caption.

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

All I tested. From the alpha 10 to the current version, beta 2. I should have post this earlier, but I thought someone else would have find it. My bad.

Is there anything else we should know?

If this issue is known, please ignore this, but I couldn’t find any related issue.

Issue Analytics

  • State:closed
  • Created 7 years ago
  • Reactions:11
  • Comments:6 (2 by maintainers)

github_iconTop GitHub Comments

10reactions
macjohnnycommented, Apr 18, 2017

Hey there We came across the same issue. According to https://bugs.chromium.org/p/chromium/issues/detail?id=20574 and https://github.com/w3c/csswg-drafts/issues/913 there seems to be a bug in the CSS specs when using a position: fixed element inside a container with a translate transform, e.g. transform: translate3d(10px,0,0).

Here in md-sidenav, the transform: translate3d() is added to the <md-sidenav-container> and the .mat-sidenav-content elements.

So far, the only workaround we have found is to overwrite the transform property to transform: initial !important, since we are not using the push mode of the sidenav.

I fixed the above plunkr example to work with angular 4, and astonishingly, the issue cannot be reproduced there anymore. http://plnkr.co/edit/tWIiaz5Mmtd3g5QhCZ4d?p=preview

0reactions
angular-automatic-lock-bot[bot]commented, Sep 7, 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.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Fixed element inside mat-sidenav-content - Stack Overflow
I would like to have a fixed element inside of mat-sidenav-content while still allowing the user to scroll the content behind it when...
Read more >
How do I get a fixed sidebar to fit underneath my navbar?
Hi, I am trying to design my website to have a fixed side navbar that fits under my top navbar. Right now, the...
Read more >
Sidenav - Angular Material
The sidenav components are designed to add side content to a fullscreen app. ... They support almost all of the same features, but...
Read more >
Sidenav - Materialize
Fixed HTML Structure ... Add the class sidenav-fixed to have the sidenav be fixed and open on large screens and hides to the...
Read more >
How To Create a Fixed Sidebar - W3Schools
This sidebar is of full height (100%) and always shown. Scroll this window to see the "fixed" effect. Some text to enable scrolling....
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found