feat(cdk/scrolling): Scroll functions silently fail if the viewport is not yet fully initialized
- Vorherrschende Sprache
- TypeScript
- Sterne
- 25k
- Forks
- 6.8k
- Ø Merge
- 1 T. 8 Std.
- Gemergte PRs (30 T.)
- 91
Beschreibung
#### Feature Description
`cdk-virtual-scroll-viewport`'s `scrollTo...` functions (like `scrollToIndex`) silently fail when the viewport is not yet initialized. Technically the functions are doing nothing wrong from a code standpoint, but since the component is not yet fully initialized, it is empty, so trying to scroll will do nothing meaningful. Sending back an error (or at least logging a warning to the console) if an empty viewport is scrolled would be helpful so that developers know that something went wrong.
This would be mitigated if we had an async option that managed the timing of scroll commands. See [this feature request](https://github.com/angular/components/issues/23715).
#### Use Case
This would improve every use case of the virtual scroller.
Beitragsleitfaden
Rechercherichtung
Beginne bei den cdk-virtual-scroll-viewport scrollTo...-Einstiegspunkten und untersuche, wie die Initialisierung und ein leerer Viewport dargestellt werden. Kläre mit den Maintainers, ob das abgeschlossene Verhalten ein Fehler oder eine Konsolenwarnung sein sollte, und füge eine gezielte Abdeckung hinzu, die zeigt, dass das Scrollen vor der Initialisierung nicht mehr stillschweigend fehlschlägt.
Vom Indexierungsmodell aus dem Issue-Text verfasst.
Bewertung
- Tech-Stack
- angular, typescript
- Bereich
- frontend
- Issue-Typ
- Feature
- Schwierigkeit
- 3/5
- Geschätzter Aufwand
- 1-2 Tage
- Aktivitätsstatus
- Veraltet
- Klarheit
- Größtenteils klar
- Anfängerfreundlichkeit
- 35/100