I try to implement a Sidenav that contains a list of Angular Material Expansion Panels. When I'm using the ngFor-directive the layout looks fine, just as I want it. As you can see in the image, it expands the view to 100% of the width of the Expansion-Panel-content.
Layout using ngFor-directive.
Stackblitz of how it looks with ng-For-directive:
https://stackblitz.com/edit/angular-ivy-fwav88?file=src/app/app.component.ts
Since there will possibly be thousands of items in the list I want to increase the performance using CDK virtual Scroll.
But using this, I was not able to set the width of the list to 100%. Instead, there is a horizontal scroll bar.
How it looks with virtual scroll.
Stackblitz of the Code with virtual scroll: https://stackblitz.com/edit/angular-ivy-xr5bok?file=src/app/sidenav/sidenav.component.html
I tried to use flexbox and every other CSS-Tricks I know but without any success.
I would be really grateful for the help.
Thanks!