leecade / leecade/react-native-swiper

onIndexChanged does not get called after swiping

Open
#1,050 2 comments 8 reactions 0 assignees View on GitHub

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 ?

iOS and Android

Version

Which versions are you using:

  • react-native-swiper v1.5.14
  • react-native v0.60.5
Expected behaviour

onIndexChanged gets called twice and in order when I swipe, release, and quickly swipe again.

Actual behaviour

onIndexChanged only gets called once (with the latest index) when I swipe, release, and quickly swipe again, therefore skipping one of the indexes in my swiper and messing up my state.

Steps to reproduce
  1. Make a swiper with three elements.
  2. Start at the first element, swipe to the second one, quickly release finger and swipe again to the third one.
  3. Log the onIndexChanged results to see how the middle index (1) gets skipped.

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

Start with a three-element swiper on iOS and Android using react-native-swiper v1.5.14 and React Native v0.60.5. Reproduce the rapid swipe from index 0 to 1 to 2 while logging onIndexChanged, then trace the event handling that produces the callback. Done means the callback reports both intermediate and final indexes in order.

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
Clearly specified
Newbie friendliness
42/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.