angular / angular/components

bug(cdk-virtual-scroll-viewport): Scrollbar scrolls down a distance

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

Description

#### Reproduction

https://stackblitz.com/edit/angular-jwh2bj?file=src%2Fapp%2Fcdk-virtual-scroll-overview-example.html

Steps to reproduce:
1. Click **Menu** button.
2. Click **Remove with problem** button.


#### Expected Behavior

The scrollbar is still keeping the current position.

#### Actual Behavior

It scrolls down some distances.

#### Environment

- Angular: 9.0.0
- CDK/Material: 9.0.0
- Browser(s): Chrome 84.0.4147.89 64 bit
- Operating System (e.g. Windows, macOS, Ubuntu): Windows 10

Contributor guide

Open the contributing guide

Research direction

Start with the linked StackBlitz reproduction and follow the Menu and Remove with problem steps in the cdk-virtual-scroll-viewport example. Confirm the scrollbar moves from its current position after removal, then trace the relevant virtual-scroll behavior and add or update coverage so the position remains unchanged.

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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.