bug(virtual-scroll): scrollToIndex does not work for multiple viewports scrolling over the same element
- 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
If you have multiple viewports beneath eachother the function 'scrollToIndex' does not work if you want to scroll to an element in one of the bottom lists. It scrolls to a wrong position.
### Reproduction
StackBlitz link: https://stackblitz.com/edit/components-issue-dch1m4?file=src%2Fapp%2Fexample-component.html,src%2Fapp%2Fexample-component.ts,src%2Fapp%2Fexample-component.css
Steps to reproduce:
1. Click the button 'Scroll to viewport 3 and index 7'
2. It scrolls to the wrong position.
### Expected Behavior
It should scroll to the correct position.
### Actual Behavior
It should scroll to the wrong position.
### Environment
- Angular: 16.2.1
- CDK/Material: 16.2.1
- Browser(s): Chrome
- Operating System (e.g. Windows, macOS, Ubuntu): Stackblitz
Guide de contribution
Ouvrir le guide de contribution
Piste de recherche
Commencez par la reproduction StackBlitz liée, en particulier src/app/example-component.html et src/app/example-component.ts, et exécutez les étapes pour faire défiler jusqu’à viewport 3 et index 7. Suivez le comportement de virtual-scroll pour plusieurs viewports partageant un même élément et comparez la position obtenue avec la cible attendue. C’est terminé lorsque le bouton fait défiler jusqu’au bon élément dans le viewport inférieur.
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