Skip to content

Sidenav - .mat-sidenav-opened is not being applied after switching mode from side to over #6062

Closed

Description

@dmitrysteblyuk

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

Activity

  1. willshowell commented on Jul 26, 2017

    @willshowell
    Contributor

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

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

  2. dmitrysteblyuk commented on Jul 26, 2017

    @dmitrysteblyuk
    Author

    @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.

  3. willshowell commented on Jul 26, 2017

    @willshowell
    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

  4. mmalerba commented on Oct 13, 2017

    @mmalerba
    Contributor

    fixed by #6712

  5. angular-automatic-lock-bot commented on Sep 7, 2019

    @angular-automatic-lock-bot

    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.

  6. locked and limited conversation to collaborators on Sep 7, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions