components icon indicating copy to clipboard operation
components copied to clipboard

bug(cdk-virtual-scroll-viewport): Does not work with ngZoneRunCoalescing

Open andershessellund opened this issue 3 years ago • 3 comments

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:

  1. Go to https://stackblitz.com/edit/cdk-virtual-scroll-bug-run-coalescing
  2. 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

andershessellund avatar Oct 13 '22 12:10 andershessellund

Guys, please fix this. It has bad visual effect. Our product (and any other) with this glitch looks very unprofessional.

stasberkov avatar Sep 06 '23 13:09 stasberkov

We also have user complaints (flicking) about big list virtual scrolling. Can you please advise?

VitalyVoroshilov avatar Sep 07 '23 06:09 VitalyVoroshilov

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);
    }
}

stasberkov avatar Feb 20 '24 18:02 stasberkov