bug(cdk-virtual-scroll): Using cdkVirtualFor with ng-container doesn't render all items
- Dominant language
- TypeScript
- Stars
- 25k
- Forks
- 6.8k
- Avg merge
- 1d 8h
- Merged PRs (30d)
- 91
Description
#### Reproduction
https://stackblitz.com/edit/angular-afvrep
Steps to reproduce:
Click on the add button and new items will be added. Scroll down slowly until you see:

Item 49 didn't render well. If you scroll more down and back up item 49 will suddenly appear as needed.
#### Expected Behavior
All items should be rendered correctly
#### Actual Behavior
Some items (49 here) don't render as expected
#### Environment
-Angular: 10.2.2
-CDK/Material: 10.2.7
-Browser(s): Chrome Version 86.0.4240.111 (Official Build) (64-bit)
-Operating System (e.g. Windows, macOS, Ubuntu): Windows 10
Contributor guide
Research direction
Start with the linked StackBlitz reproduction and reproduce the missing item while scrolling after adding items. Trace the cdkVirtualFor and ng-container virtual-scroll behavior; the issue is done when all added items render correctly during scrolling without needing to scroll away and back.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- angular, typescript
- Domain
- frontend
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100