leecade / leecade/react-native-swiper
Swiper calculating index incorrectly when children count changes
Nobody has claimed this yet.
- Dominant language
- JavaScript
- Stars
- 10.5k
- Forks
- 2.3k
- PR merge metrics
- No merged PRs in 30d
Description
Which OS ?
Both Android and iOS.
Version
Which versions are you using:
- react-native-swiper v? 1.5.14
- react-native v0.?.? 0.55.4
Expected behaviour
Expect the component to calculate the correct index.
Actual behaviour
The component wrongly updates the index.
How to reproduce it>
To help us, please fork this component, modify one example in examples folder to reproduce your issue and include link here.
Steps to reproduce
- Create a react-native-swiper with n children components and place some dot navigation markers.
- Swipe to the last component of the swiper.
- Update the swiper children with (n-1) components.
- The component will render correctly.
- Try to swipe back. The component will navigate accordingly, but the dots aren't updated correctly, because index is calculated wrongly.
Additional Notes
I've supposedly found the bug. I can make a PR if requested.
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Use the reproduction steps in the issue with a React Native Swiper containing n children, then replace them with n-1 children and swipe back. The issue points to modifying an example in the examples folder; confirm that the rendered component and dot navigation both show the correct index after the child count changes.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- javascript, react-native
- Domain
- mobile
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 42/100