Scenario:
- Tried a basic virtual scroll test reading this blog post
- the array had lots of items
- there was no error
- the list loaded in a virtual scroll but the height of it was 0 by default
quick fix was to
- set the height for cdk-virtual-scroll-viewport to 500px or set the height for class 'example-viewport' in app.component.css
Question: what is the proper way to overcome this zero height?
height: 100%;
it will get the parents height, you can handle the parents size as any other div in your page.cdk-virtual-scroll-viewport
element is totally arbitrary and a hit or miss. TheitemSize
property makes no sense at all, so you have to play with styles and the property until you get it about right. The documentation and the design of the component is a joke.