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] Issue when container and sidenav in different components

See original GitHub issue

Bug, feature request, or proposal:

I have the template like this: <mat-sidenav-container class="sidenav-container"> <my-component></my-component> ... </mat-sidenav-container>

<my-component> is: <mat-sidenav #leftSidenav class="sidenav" mode="side" [opened]="true"> ... </mat-sidenav>

When I have my sidenav in two components like this, the mode “side” is not working anymore. The mode switch to “over”. When I have all in the same component, it’s working.

I think it’s due to a another tag between <mat-sidenav-container> and <mat-sidenav> and it break the css rules.

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

Angular Material 5.0.1

Issue Analytics

  • State:open
  • Created 6 years ago
  • Reactions:9
  • Comments:6 (3 by maintainers)

github_iconTop GitHub Comments

3reactions
mmalerbacommented, Jan 9, 2018

This use case is not currently supported, instead you would do something like this:

<mat-sidenav-container>
  <mat-sidenav>
    <my-sidenav></my-sidenav>
  </mat-sidenav>
  <mat-sidenav-content>
    <my-content></my-content>
  </mat-sidenav-content>
</mat-sidenav-container>
2reactions
rutgervdcommented, Jan 26, 2018

I would also love to see this split-up!

Read more comments on GitHub >

github_iconTop Results From Across the Web

angular - Issue when mat-sidenav-container and ...
I have separated out mat-sidenav-container and mat-sidenav into two different components. When I have my sidenav in two components like this ...
Read more >
I want to re-use a sidenav in multiple components. Anyone ...
So I have one "home" component, one "Contact", one "sidenav" and one "toolbar". I want the "sidenav" component to display everything inside ...
Read more >
Sidenav
The sidenav components are designed to add side content to a fullscreen app. To set up a sidenav we use three components: <mat-sidenav-container>...
Read more >
Angular Material2 Sidenav Issue (forked)
Small project to demonstrate vertical tabs using Angular Material 2.
Read more >
Angular Material: toolbar and sidenav - Rob Ferguson
After looking at the @angular/material:material-nav starter component's sample code I decided to generate a toolbar component and a sidenav ...
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