callstack / callstack/react-native-pager-view
With dynamic input, pager view assumes the new added element is at the end and not at the beginning.
- Vorherrschende Sprache
- TypeScript
- Sterne
- 3.4k
- Forks
- 476
- Ø Merge
- 10 T. 21 Std.
- Gemergte PRs (30 T.)
- 2
Beschreibung
if we pass an array and we update the array adding a new element at the beginning of the array, native pager assumes that the element is added at the end. There should be an option to edit this.
This causes various bugs:
- setPage doesn't work. Calling setPage(0) actually scrolls to the second element given that a new one was added but it's not take into account.
- the scroll dots go out of sync.
The code is simply the standard example of PagerView but passing an array with an extra element at the beginning dynamically.
Beitragsleitfaden
Rechercherichtung
Beginne mit dem im Issue beschriebenen standardmäßigen PagerView-Beispiel und reproduziere den Fall, in dem ein Array am Anfang ein Element erhält. Verfolge, wie dynamische untergeordnete Elemente, setPage(0) und die Scroll-Dots auf diese Änderung reagieren. Als abgeschlossen gilt die Aufgabe, wenn das Voranstellen eines Elements die ausgewählte Seite und die Dots synchron hält.
Vom Indexierungsmodell aus dem Issue-Text verfasst.
Bewertung
- Tech-Stack
- react-native, typescript
- Bereich
- mobile
- Issue-Typ
- Bug
- Schwierigkeit
- 4/5
- Geschätzter Aufwand
- 3-5 Tage
- Aktivitätsstatus
- Veraltet
- Klarheit
- Größtenteils klar
- Anfängerfreundlichkeit
- 35/100