angular / angular/components

cdk virtual scroll emit scroll event after visual scroll

Open
#20,693 5 comments 0 reactions 0 assignees View on GitHub
area: cdk/scrolling P5
Dominant language
TypeScript
Stars
25k
Forks
6.8k
Avg merge
1d 8h
Merged PRs (30d)
91

Description

Reproduction:
https://stackblitz.com/edit/angular-7xvdmw?file=src%2Fapp%2Fcdk-virtual-scroll-context-example.ts

Steps to reproduce:
Put a breakpoint on the two different console.log (one in normal div and one in elementScrolled())
Try to scroll on the normal div and the one with virtual scroll

Actual Behavior
- The normal div will stop at the breakpoint when you try to scroll, there it no visual scrolling at this time. The visual scrolling is after the scroll event.
- The cdkScrollable emit the scroll event after the visual scrolling. Even I put a (scroll) in the html, I still got the event after the visual scroll.

The scroll event should emit before the visual scroll.

Environment
Angular: 10.0.0
CDK/Material: 10.0.0
Browser(s): chrome
Operating System (e.g. Windows, macOS, Ubuntu): windows

Contributor guide

Open the contributing guide

Research direction

Start with the linked StackBlitz reproduction, especially src/app/cdk-virtual-scroll-context-example.ts, and compare the normal div's scroll handler with cdkScrollable.elementScrolled(). Reproduce the breakpoint ordering in Chrome, then trace the CDK virtual-scroll event path. Done means the scroll event is emitted before visual scrolling, with the reproduction demonstrating the corrected order.

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
38/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.