angular / angular/components

bug(scrolling): Opening dialog in window virtual scroll break scrolling

Ouverte
#26,240 3 commentaires 4 réactions 0 personnes assignées Voir sur GitHub
area: cdk/scrolling P3
Langage dominant
TypeScript
Étoiles
25k
Forks
6.8k
Merge moyen
1 j 8 h
PR mergées (30 j)
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

[cdk-virtual-scroll-viewport[scrollWindow]](https://material.angular.io/cdk/scrolling/api#CdkVirtualScrollableWindow) is empty when opening a `mat-dialog` if the window have been scrolled.

When the dialog is closed, everything returns to normal but the scroll is restored to top 0.

### Reproduction

Steps to reproduce:
1. Go to https://stackblitz.com/edit/angular-psylrc
2. Click on "open dialog" button of the 100th line

### Expected Behavior

The virtual scroll should not be influenced by dialog

### Actual Behavior

Virtual scroll container become empty and when the dialog is closed the items come back but the scroll is restored to 0

### Environment

- Angular: 15.0.2
- CDK/Material: 15.0.2
- Browser(s): any
- Operating System (e.g. Windows, macOS, Ubuntu): any

Guide de contribution

Ouvrir le guide de contribution

Piste de recherche

Commencez par la reproduction StackBlitz liée et examinez l’interaction entre cdk-virtual-scroll-viewport[scrollWindow] et mat-dialog après avoir fait défiler jusqu’à la 100e ligne. Reproduisez le viewport vide et la restauration du défilement à 0, puis vérifiez que l’ouverture et la fermeture de la boîte de dialogue laissent le défilement virtuel rempli à sa position d’origine.

Rédigé par le modèle d'indexation à partir du texte de l'issue.

Évaluation

Stack technique
angular, typescript
Domaine
frontend
Type d'issue
Bug
Difficulté
3/5
Temps estimé
1-2 jours
Activité
À l'abandon
Clarté
Plutôt claire
Accessibilité débutants
35/100

Recevez les nouvelles issues par e-mail

Un résumé court des issues GitHub adaptées aux débutants.