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 - .mat-sidenav-opened is not being applied after switching mode from side to over #6062

Closed
dmitrysteblyuk opened this issue Jul 26, 2017 · 5 comments
Assignees

Comments

@dmitrysteblyuk
Copy link

Bug, feature request, or proposal:

Bug

What is the expected behavior?

Class mat-sidenav-opened should be added to <md-sidenav-container> in mode over (or perhaps for all modes?).

What is the current behavior?

The class is not being added if the component was initialized with side mode and then switched to over.

What are the steps to reproduce?

Providing a Plunker (or similar) is the best way to get the team to see your issue.
Plunker template: https://plnkr.co/edit/GmUshVTgSxCXe1gcruXx?p=preview

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

When changing size of the screen (e.g. rotating device) it is useful to change mode between side and over. Class mat-sidenav-opened is also useful as it tells when side-nav is closed and animation completed.

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

Browser: Chrome

@angular/cli: 1.2.0
node: 8.0.0
os: win32 x64
@angular/animations: 4.3.1
@angular/cdk: 2.0.0-beta.8
@angular/common: 4.3.1
@angular/compiler: 4.3.1
@angular/core: 4.3.1
@angular/forms: 4.3.1
@angular/http: 4.3.1
@angular/material: 2.0.0-beta.8
@angular/platform-browser: 4.3.1
@angular/platform-browser-dynamic: 4.3.1
@angular/platform-server: 4.3.1
@angular/router: 4.3.1
@angular/cli: 1.2.0
@angular/compiler-cli: 4.3.1
@angular/language-service: 4.3.1

@willshowell
Copy link
Contributor

You should be querying mat-sidenav, not mat-sidenav-container

https://plnkr.co/edit/QMJoGWtLAOXbGJl9KN7L?p=preview

@dmitrysteblyuk
Copy link
Author

dmitrysteblyuk commented Jul 26, 2017

@willshowell for over mode this class is applied to container as well
https://plnkr.co/edit/0ja1auGaL6cUlYCkvNdk?p=preview

Sometimes it is necessary to have classes in parent elements, not in children.

@willshowell
Copy link
Contributor

Oh I see, thanks for clarifying! Looks like it only subscribes at the beginning and only if mode !== side

https://github.com/angular/material2/blob/master/src/lib/sidenav/sidenav.ts#L415-L418

@mmalerba
Copy link
Contributor

fixed by #6712

@angular-automatic-lock-bot
Copy link

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.

@angular-automatic-lock-bot angular-automatic-lock-bot bot locked and limited conversation to collaborators Sep 7, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants