bug(virtual-scroll): scrollToIndex does not work for multiple viewports scrolling over the same element
- Vorherrschende Sprache
- TypeScript
- Sterne
- 25k
- Forks
- 6.8k
- Ø Merge
- 1 T. 8 Std.
- Gemergte PRs (30 T.)
- 91
Beschreibung
### 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
Beitragsleitfaden
Rechercherichtung
Beginne mit der verlinkten StackBlitz-Reproduktion, insbesondere mit src/app/example-component.html und src/app/example-component.ts, und führe die Schritte zum Scrollen zu viewport 3 und index 7 aus. Verfolge das virtual-scroll-Verhalten für mehrere Viewports, die sich ein Element teilen, und vergleiche die resultierende Position mit dem erwarteten Ziel. Als erledigt gilt die Aufgabe, wenn die Schaltfläche zum richtigen Element im unteren Viewport scrollt.
Vom Indexierungsmodell aus dem Issue-Text verfasst.
Bewertung
- Tech-Stack
- angular, typescript
- Bereich
- frontend
- Issue-Typ
- Bug
- Schwierigkeit
- 3/5
- Geschätzter Aufwand
- 1-2 Tage
- Aktivitätsstatus
- Veraltet
- Klarheit
- Größtenteils klar
- Anfängerfreundlichkeit
- 35/100