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.
- Dominant language
- TypeScript
- Stars
- 3.4k
- Forks
- 476
- Avg merge
- 10d 21h
- Merged PRs (30d)
- 2
Description
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.
Contributor guide
Research direction
Start with the standard PagerView example described in the issue and reproduce the case where an array receives an element at the beginning. Trace how dynamic children, setPage(0), and the scroll dots respond to that change. Done means prepending an element keeps the selected page and dots synchronized.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- react-native, typescript
- Domain
- mobile
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100