When using the cdk virtual viewport, need to set the height of the viewport
.example-viewport {
height: 800px;
width: 100%;
border: 1px solid black;
}
<cdk-virtual-scroll-viewport class="example-viewport">
<div *cdkVirtualFor="let item of items" class="example-item">{{item}}</div>
</cdk-virtual-scroll-viewport>
But i want the cdk-virtual-scroll-viewport to have wrap the content items if it is not reaching max height to appear scrollbar. But the viewport is not working with max-height.
If there is no horizontal scrollbar, then the viewport sets with height to maximum height is ok. But in my current design UI, i need to show the horizontal scrollbar because lots of content columns like below attached image.
Then the scroll bar is far below due to the height of the viewport. The row items will increase by time, but before the items are increased to max height, i want the horizontal scrollbar wrap to the content height, but currently seems not able to achieve.
The reason i don't use mat-table is that the i want to support infinite scrolling and render the items that fit to screen. Mat-table doesn't support this, if i continue scroll down and request data, the rows items increased in the template and impact on performance.
Anyone has better suggestion?
Thanks a lot.