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

Open
ghost opened this issue Dec 12, 2017 · 6 comments
Open

[Sidenav] Issue when container and sidenav in different components #8959

ghost opened this issue Dec 12, 2017 · 6 comments
Labels
area: material/sidenav feature This issue represents a new feature or feature request rather than a bug or bug fix P4 A relatively minor issue that is not relevant to core functions

Comments

@ghost
Copy link

ghost commented Dec 12, 2017

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 and and it break the css rules.

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

Angular Material 5.0.1

@andrewseguin andrewseguin changed the title Issue with SideNavContainer / SideNav in two separate components Dec 12, 2017
@mmalerba
Copy link
Contributor

mmalerba commented 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>
@mmalerba mmalerba added feature This issue represents a new feature or feature request rather than a bug or bug fix P4 A relatively minor issue that is not relevant to core functions labels Jan 9, 2018
@rutgervd
Copy link

I would also love to see this split-up!

@ironstine
Copy link

Would also love to see all sidenav 'modes' working when splitting out into different components via transclusion/content-projection.

Currently only 'over' works...

Repro on stackblitz: https://stackblitz.com/edit/angular-material-sidenav-mode

Mode is set to 'push' while showing behaviour of 'over' in /app/components/sidenav.component

The sidenav split out approach is also used by the ngrx team in their example app: https://github.com/ngrx/platform/tree/v4.1.1/example-app

You can reproduce the issue in the example-app by trying to set the mode to 'push' or 'side'.

@LeonBernstein
Copy link

According to official docs: "The must be placed as an immediate child of the ."

@angular-robot
Copy link
Contributor

angular-robot bot commented Feb 1, 2022

Just a heads up that we kicked off a community voting process for your feature request. There are 20 days until the voting process ends.

Find more details about Angular's feature request process in our documentation.

@angular-robot
Copy link
Contributor

angular-robot bot commented Feb 21, 2022

Thank you for submitting your feature request! Looks like during the polling process it didn't collect a sufficient number of votes to move to the next stage.

We want to keep Angular rich and ergonomic and at the same time be mindful about its scope and learning journey. If you think your request could live outside Angular's scope, we'd encourage you to collaborate with the community on publishing it as an open source package.

You can find more details about the feature request process in our documentation.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area: material/sidenav feature This issue represents a new feature or feature request rather than a bug or bug fix P4 A relatively minor issue that is not relevant to core functions
6 participants