bug(cdkTable & mat-table): virtual scrolling shifting issues introduced in 21.1
Maintainer antworten meist innerhalb von 1 Tag
Dieses Issue hat noch niemand übernommen.
Bewertung
- Schwierigkeit
- 4/5
- Geschätzter Aufwand
- 3-5 Tage
- Anfängerfreundlichkeit
- 48/100
- Issue-Typ
- Bug
- Klarheit
- Größtenteils klar
- Aktivitätsstatus
- Ruhig
- Tech-Stack
- angular, typescript
- Bereich
- frontend
Rechercherichtung
Beginne damit, die StackBlitz-Tabellenbeispiele von v21.0 und v21.1.1 zu vergleichen, insbesondere das Verhalten von virtual-scroll und das DataSource-Beispiel. Kommentiere in der dritten Reproduktion die asynchrone Implementierung in table-virtual-scroll-example.component.ts aus und beobachte beim Scrollen collectionViewer.onViewChange range.end. Als erledigt gilt die Aufgabe, wenn mat-table und cdkTable ohne Verschiebung scrollen und das unendliche Scrollen Seiten nicht wiederholt abruft.
Vom Indexierungsmodell aus dem Issue-Text verfasst.
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
21.0.0
Description
In version v20.0.0 we had used a custom virtual scrolling strategy to allow tables with sticky headers. Upgrade to 21.0.0 broke the custom scrolling strategy implementation we have used so we decided to look for alternatives. Luckily, It seems that 21.0 also introduced support for tables with sticky header (or was introduced earlier, I am actually not sure which version added support), unfortunately, version 21.1 seems to introduce a bug which makes the scrolling shift around.
The bug can be seen in the example provided in the Table documentation as well. The documentation is still running on 21.0.0 but if you upgrade the example to 21.1.1, you can start seeing the buggy behavior when scrolling.
Scrolling seems to be fixed when itemSize is set to 0, however, in infinite scrolling implementations using DataSource that rely on collectionViewer.onViewChange range.end, it will continuously fetch the next page since range.end will always be the max value (3rd stackblitz link in the reproduction links has an async implementation mocked example that can be tested if uncommented in table-virtual-scroll-example.component.ts in constructor)
Example provided is on mat-table but cdkTable's behavior is the same if not worse
Reproduction
StackBlitz link:
v21.0 (original example on version 21.0): https://stackblitz.com/edit/dfp4dgn5?file=src%2Fexample%2Ftable-virtual-scroll-example.ts&startScript=start
v21.1.1 (original example but on version 21.1.1): https://stackblitz.com/edit/6wi4nsxd?file=src%2Fexample%2Ftable-virtual-scroll-example.ts&startScript=start
v21.1.1 with DataSource: https://stackblitz.com/edit/gt9emjwr?file=src%2Fexample%2Ftable-virtual-scroll-example.ts (much more noticeable in this example)
Steps to reproduce:
- Scroll around using the scroll wheel (also happens when you drag around the scrollbar thumb especially visible in tables with small amount of rows)
- 3rd link has an infinite scrolling implementation that can be tested if uncommented in
table-virtual-scroll-example.component.ts's constructor
Expected Behavior
The table should scroll correctly without shifting around
Actual Behavior
Scrolling shifts around, some cases making it impossible to even scroll back up once you go all the way down and some cases scrolls upwards when scrolling down
Environment
- Angular: 21.1.1
- CDK/Material: 21.1.1
- Browser(s): Chrome
- Operating System (e.g. Windows, macOS, Ubuntu): Windows & macOS
- Vorherrschende Sprache
- TypeScript
- Sterne
- 25k
- Forks
- 6.9k
- Ø Merge
- 2 T. 7 Std.
- Gemergte PRs (30 T.)
- 83
Entwicklungsumgebung
- Kein Dockerfile und keine Docker-Compose-Datei
- Keine Pull-Request-Vorlage
- Beitragsleitfaden lesen
Erste Schritte
- Lesen Sie das ganze Issue und danach den Beitragsleitfaden des Projekts.
- Schreiben Sie ins Issue, dass Sie es übernehmen — das erspart doppelte Arbeit.
- Forken Sie das Repository und arbeiten Sie in einem Branch.
- Öffnen Sie einen Pull Request, der die Issue-Nummer nennt.
Mehr aus angular/components
-
bug(mat-slider): on Firefox, slider thumb is not aligned with cursorEvtl. vergeben @Devyalamaddi hat das vor 4 Tagen übernommen. Offenarea: material/slider P4
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 62/100
angular/components#34094 · 1 Kommentar ·
Maintainer antworten meist innerhalb von 1 Tag
-
bug(material/sort): hover hint arrow on an unsorted header shows the active sort direction, not the resulting direction after click.Evtl. vergeben @abdul-karim-mia hat das vor 2 Tagen übernommen. Offenarea: material/sort P3
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 70/100
angular/components#33933 ·
Maintainer antworten meist innerhalb von 1 Tag
-
bug(mat-date-picker): month shown twice in date pickerEvtl. vergeben @PreethiPantangi hat das vor 54 Tagen übernommen. Offenarea: material/datepicker P4
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 72/100
angular/components#33763 · 2 Kommentare · 3 Reaktionen ·
Maintainer antworten meist innerhalb von 1 Tag
-
Bug in table.scss footer cell height: unset instead of footer row height unsetEvtl. vergeben @minwookshin hat das vor 41 Tagen übernommen. Offenarea: material/table P4
Schwierigkeit 1/5 Unter einer Stunde Anfängerfreundlichkeit 88/100
angular/components#33709 · 1 Kommentar ·
Maintainer antworten meist innerhalb von 1 Tag
-
bug(date-adapter): Misleading JSDoc for createDate returns typeEvtl. vergeben @BHUVANSH855 hat das vor 171 Tagen übernommen. Offenarea: material/core P3
Schwierigkeit 1/5 Unter einer Stunde Anfängerfreundlichkeit 78/100
angular/components#33059 · 2 Kommentare ·
Maintainer antworten meist innerhalb von 1 Tag
Alle Issues in angular/components
Ähnliche Issues
-
bug parity
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 70/100
WenyuChiou/agent-board#1489 ·
Maintainer antworten meist innerhalb von 1 Tag
-
area: bazaar bug complexity: medium
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 74/100
accensa/x402-facilitator-stellar#779 ·
Maintainer antworten meist innerhalb von 1 Tag
-
bug good first issue P4 size:S web-ui
Schwierigkeit 2/5 Ein halber Tag Anfängerfreundlichkeit 85/100
josephfung/curia#2600 ·
Maintainer antworten meist innerhalb von 1 Tag
-
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 62/100
cloudflare/partykit#444 ·