leecade / leecade/react-native-swiper
Entire window shifts when updating from state change
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
Version
Which versions are you using:
- react-native-swiper v1.5.12
- react-native v0.48.3
Expected behaviour
Updating the state and the subsequent re-rendering it causes shouldn't cause any of the existing slider layout to change (current index, positioning, etc.)
Actual behaviour
Updating the state when the swiper is not fullscreen causes the content and slides inside the swiper to shift drastically. Here's an example (all I'm doing is setting a timeout to change the text from "Hello Swiper" to "Hi Swiper" via setState() and it causes everything to go out of whack):

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
- Add the swiper to a view
- Make its parent view less than 100% in height
- Update any state object that would force the swiper or view to re-render
Any help would be greatly appreciated.. I'm trying to use this swiper in an actionsheet/modal at the bottom of the screen (about 500pt in height) and any re-rendering causes the entire layout to get messed up.
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
The reproduction entry point mentioned is examples/components/Basic/index.js; start by running that example on iOS with a non-fullscreen parent and a state update. Compare the swiper layout before and after the re-render. Done means the current index, positioning, content, and surrounding layout remain stable in the described case.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- javascript, react-native
- Domain
- mobile-dev
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 30/100