bug(cdk-virtual-scroll-viewport): Does not work with ngZoneRunCoalescing
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
cdk-virtual-scroll-viewport does not work with ngZoneRunCoalescing enabled. Some frames are rendered with incorrect content, causing visual "glitches".
Reproduction
Steps to reproduce:
- Go to https://stackblitz.com/edit/cdk-virtual-scroll-bug-run-coalescing
- Scroll . The bug is most apparent when scrolling slowly.
Expected Behavior
All rendered frames has correct content during scrolling.
Actual Behavior
Some frames are rendered with incorrect content, causing glitches.
Environment
- Angular: 14.2.6
- CDK/Material: 14.2.5
- Browser(s): Safari, Chrome
- Operating System (e.g. Windows, macOS, Ubuntu): iOS, macOS
Guys, please fix this. It has bad visual effect. Our product (and any other) with this glitch looks very unprofessional.
We also have user complaints (flicking) about big list virtual scrolling. Can you please advise?
This nasty visual glitch goes away if using custom scrolling strategy like this
export class CustomVirtualScrollStrategy extends FixedSizeVirtualScrollStrategy {
constructor() {
super(60, 250, 500);
}
override onContentScrolled(): void {
setTimeout(() => super.onContentScrolled(), DEFAULT_SCROLL_TIME);
}
}