leecade / leecade/react-native-swiper

1.6.0-rc.3 - problem with loop props

Open
#1,090 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

🚧processing
Dominant language
JavaScript
Stars
10.5k
Forks
2.3k
PR merge metrics
No merged PRs in 30d

Description

Which OS ?

Android / IOS

Version

Which versions are you using:

  • "react-native-swiper": "^1.6.0-rc.3",
  • "react-native": "0.61.2",

Untitled mov

First part of video

  <Swiper
    dot={<View style={styles.dot} />}
    activeDot={<View style={styles.activeDot} />}
    onIndexChanged={(index) => onIndexChanged(index, onboardingTexts.length - 1)}
    loop={false}
  >

Second part

  <Swiper
    dot={<View style={styles.dot} />}
    activeDot={<View style={styles.activeDot} />}
    onIndexChanged={(index) => onIndexChanged(index, onboardingTexts.length - 1)}
  >

When we add loop = {false} swiper works as expected
But when use the default loop = {true}

  1. the first page has been changed
  2. when we got to the last slide - page has been changed too

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 by reproducing the issue with the two Swiper examples in the report on react-native-swiper 1.6.0-rc.3 and React Native 0.61.2, comparing loop=false with the default loop=true on Android and iOS. Trace the loop behavior around the first and last slides and verify that both page selection and onIndexChanged results remain correct.

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
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.