leecade / leecade/react-native-swiper

Swiper calculating index incorrectly when children count changes

Open
#1,060 2 comments 4 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

🐛bug Resolution: Old Version
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
  1. Create a react-native-swiper with n children components and place some dot navigation markers.
  2. Swipe to the last component of the swiper.
  3. Update the swiper children with (n-1) components.
  4. The component will render correctly.
  5. 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

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. 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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.