bug(cdkTable): virtual scroll does not work for tables with cdkRowDefWhen
- Dominant language
- TypeScript
- Stars
- 25k
- Forks
- 6.8k
- Avg merge
- 1d 8h
- Merged PRs (30d)
- 91
Description
### Is this a regression?
- [ ] Yes, this behavior used to work in the previous version
### The previous version in which this bug was not present was
_No response_
### Description
Virtual scroll does not work for tables with multiple cdkRow definitions. Properties remain undefined when a line from another definition is reused.
### Reproduction
StackBlitz link: [cdk-table-virtual-scroll-example](https://stackblitz.com/edit/pye7nuce?file=src%2Fexample%2Fcdk-table-virtual-scroll-example.html)
Steps to reproduce:
1. download and update the project to Angular 21.1 (sorry, I struggled with updating on StackBlitz)
2. run the project and scroll the tables down
### Expected Behavior
See the lines as if there were no virtual scroll.
### Actual Behavior
Rows that have reused a row of the other definition doesn't show their property. It is undefined.
### Environment
- Angular: 21.1.0
- CDK/Material: 21.1.0
- Browser(s):
- Operating System (e.g. Windows, macOS, Ubuntu):
Contributor guide
Research direction
Start with the linked StackBlitz cdk-table-virtual-scroll-example, update it to Angular 21.1, run it, and scroll the tables to reproduce the issue. Trace the virtual-scroll table behavior with multiple cdkRowDefWhen definitions; done means reused rows show their properties just as they do without virtual scroll.
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
- Quiet
- Clarity
- Mostly clear
- Newbie friendliness
- 55/100