I would like to do something like this:
<cdk-virtual-scroll-viewport [itemSize]="25">
<svg>
<g *cdkVirtualFor="let item of items">...</g>
</svg>
<div *cdkVirtualFor="let item of items">...</div>
</cdk-virtual-scroll-viewport>
And have both the g
and div
elements scroll at at the same time (they both have the same height). Is this possible? Doing exactly as I have outlined here results in an error: Error: CdkVirtualScrollViewport is already attached.
Here is how I was able to achieve 2 lists with virtual-scroll: I combined the lists, added a type, sort your list by type, and did a break when type is changed:
TypeScript:
HTML: