I'm having a problem with a div using position: sticky; inside mat-drawer-container. Here's what I've tried:
.mat-drawer-container.my-drawer-container {
overflow: scroll;
}
.mat-drawer-content.my-drawer-content {
overflow: scroll;
}
with no luck :(
Any thoughts?
This doesn't work
https://stackblitz.com/edit/angular-aqk1oj-pg4xq8
This works (the desired result)
In your example, the class names used in the template and styles do not match. Once that is corrected you will see that
overflow: scrollundesirably gives two scrollbars within the container.The default value for the
overflowproperty in themat-drawer-containerandmat-drawer-contentclasses ishidden. Whenoverflow: hiddenis set to any ancestor of a sticky element, the ancestor element will become the scrolling container. To avoid this, simplyunsettheoverflowproperty.The
divwill now besticky.