bug(cdk-virtual-scroll): use ngIf inside cdk-virtual-scroll-viewport break cdkVirtualFor render datas
- Dominant language
- TypeScript
- Stars
- 25k
- Forks
- 6.8k
- Avg merge
- 1d 8h
- Merged PRs (30d)
- 91
Description
#### Reproduction
https://stackblitz.com/edit/angular-zsbplw-8een6b?file=src/app/cdk-virtual-scroll-context-example.html
Steps to reproduce:
1. click empty button
2. click rebuild button (datas no render)
3. refresh, click empty button and then click rebuild more datas button (datas render correct)

#### Expected Behavior
What behavior were you expecting to see?
datas should render correct
#### Actual Behavior
What behavior did you actually see?
no datas render
#### Environment
- Angular: 11.1.1
- CDK/Material: 11.1.1
- Browser(s): Chrome
- Operating System (e.g. Windows, macOS, Ubuntu): Windows
Contributor guide
Research direction
Start with the linked StackBlitz reproduction, especially src/app/cdk-virtual-scroll-context-example.html and the cdk-virtual-scroll-viewport/cdkVirtualFor entry points. Reproduce the empty-button then rebuild sequence, and compare it with the refresh/more-data sequence. Done means virtual-scroll data renders correctly in both sequences.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- angular, typescript
- Domain
- frontend
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Clearly specified
- Newbie friendliness
- 45/100