leecade / leecade/react-native-swiper

active dot does not update on swipe when children have changed

Open
#971 7 comments 9 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 1.5.14?
  • react-native v0.57.8
Expected behaviour

the active dot changes when i swipe

Actual behaviour

the first dot is always highlighted

How to reproduce it>
 <Swiper>
          {items.map(item => (
            <View key={item._id}><Text>{item.label}</Text></View>
          ))}
</Swiper>
Steps to reproduce
  1. make sure that items is empty first []
  2. on a later render. fill items with some objects
  3. active dot is now broken
Workaround:
 <Swiper key={items.length}>
          {items.map(item => (
            <View key={item._id}><Text>{item.label}</Text></View>
          ))}
</Swiper>

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 provided Swiper snippet: render with an empty items array, then populate it and swipe through the children. Inspect how child updates and the active-dot state are handled; done means the highlighted dot follows the currently swiped child after the items change.

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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.