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

[MatSidenav] Sidenav Toggling Can Cause Content Shifting #12349

Open
aaronrcooper opened this issue Jul 24, 2018 · 3 comments
Open

[MatSidenav] Sidenav Toggling Can Cause Content Shifting #12349

aaronrcooper opened this issue Jul 24, 2018 · 3 comments
Labels
area: material/sidenav P3 An issue that is relevant to core functions, but does not impede progress. Important, but not urgent

Comments

@aaronrcooper
Copy link

Bug, feature request, or proposal:

Bug

What is the expected behavior?

Mat-sidenav-content is not moved from original position upon quick mat-sidenav toggles

What is the current behavior?

Quick mat-sidenav toggles can cause mat-sidenav-content to be shifted over until the drawer is toggled again

What are the steps to reproduce?

Set the autofocus on mat-sidenav to true, and place a focusable input in the mat-sidenav
Click the 'open drawer' button quickly and repeatedly until the content shifts. Click the button again and the content will shift back.

https://stackblitz.com/edit/angular-eesonu

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

Use-case: User accidentally opens the drawer and quickly presses again to undo the action. This will result in possibly all content on the page not being displayed.

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

Angular: 6.0.9
Material: 6.4.1

@cedricremond
Copy link

cedricremond commented Apr 1, 2020

Hi!

This bug is still present in the latest Angular Material release (9.2.0).
I reproduced it here: https://stackblitz.com/edit/angular-ua4cyc.
Closing the sidenav and opening it quickly before it's completely closed cause a shift of the main content.

Is there a way to avoid this behavior?

EDIT: Adding [fixedToViewport]="true" to the sidenav container seems to fix the issue (https://stackblitz.com/edit/angular-pqkykw) but it's not always what we want.

@mmalerba mmalerba added the P3 An issue that is relevant to core functions, but does not impede progress. Important, but not urgent label Apr 1, 2020
@mmalerba
Copy link
Contributor

mmalerba commented Apr 1, 2020

confirmed, can still reproduce this with @aaronrcooper's example after updating the deps

@yayarokya
Copy link

Hi everyone. I can reproduce it as well.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area: material/sidenav P3 An issue that is relevant to core functions, but does not impede progress. Important, but not urgent
Projects
None yet
Development

No branches or pull requests

5 participants