angular / angular/components

bug(cdk-virtual-scroll): Using cdkVirtualFor with ng-container doesn't render all items

Open
#20,972 6 comments 0 reactions 0 assignees View on GitHub
area: cdk/scrolling P3
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:
![image](https://user-images.githubusercontent.com/30085989/98209303-5c808e00-1f47-11eb-8e14-b921188845b0.png)
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

Open the contributing 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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.