components icon indicating copy to clipboard operation
components copied to clipboard

sidenav: scroll strategies not working when mat-sidenav-container is used

Open jbojcic1 opened this issue 7 years ago • 2 comments

What is the expected behavior?

When dialog is opened inside mat-sidenav-container scroll strategies should work as usual. Block should block scrolling when dialog is opened, noop should allow scrolling, etc.

What is the current behavior?

Scroll strategies don't work when mat-sidenav-container is used. If I open dialog with backdrop and noop scroll strategy, scrolling is still blocked. If I remove backdrop and use block strategy, scrolling is still possible.

What are the steps to reproduce?

https://stackblitz.com/edit/angular-material2-issue-effkee

Open dialog and try to scroll. Play around with backdrop and scroll settings.

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

Angular, Material and CDK 7.2.2, macos, Chrome (haven't tried other browsers but I assume it's the same)

Is there anything else we should know?

/

jbojcic1 avatar Jan 29 '19 14:01 jbojcic1

I guess related as well: https://github.com/angular/material2/issues/4280

The default ScrollStrategy only stops scrolling on the body right. I guess we'd need a custom ScrollStrategy for MatSideNav and I'd guess that most people expect it to also block Sidenav scrolling.

Perhaps the library could provide a ScrollingStrategy for blocking a Sidenav scroll and support things like scrolling to top on route change

intellix avatar Mar 26 '19 06:03 intellix

check your :host css

smaillns avatar Jun 09 '24 09:06 smaillns