Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

react-native 0.48.3 and react-native-swiper - Last slide shown first #570

Closed
nixoz opened this issue Sep 14, 2017 · 7 comments · Fixed by #572
Closed

react-native 0.48.3 and react-native-swiper - Last slide shown first #570

nixoz opened this issue Sep 14, 2017 · 7 comments · Fixed by #572

Comments

@nixoz
Copy link
Contributor

nixoz commented Sep 14, 2017

Which OS ?

IOS

Version

Which versions are you using:

  • react-native-swiper v1.5.12 (but it affect every single version of it, tried back to 1.5.4 as well)
  • react-native v0.48.3

Expected behaviour

  • The first slide should be first.

Actual behaviour

  • The last slide showed first.
  • Awkward pagination display - it shows the state of the first slide, while displaying the last slide.

p.s. If loop={false} is set - everything seems fine.

How to reproduce it>

Just get the repo from
https://github.com/nixoz/swiperDemo

Steps to reproduce

  1. Create mint react-native project
  2. Copy paste first example from react-native-swiper README
  3. react-native run-ios
  4. KABOOM!
@nixoz
Copy link
Contributor Author

nixoz commented Sep 15, 2017

UPD: I guess it related to regression 'ScrollView contentOffset bug' -
facebook/react-native#15808

UPD: Yup, it is.

@mtt87
Copy link

mtt87 commented Sep 18, 2017

Yes it's a regression, not working also on RN 0.46

@longsangstan
Copy link

not working also on RN 0.44

@BenoitClaveau
Copy link

Have you try with loop=false ?

@kdong007
Copy link

same issue here

@BenoitClaveau
Copy link

The bug is here
if (loop) {
pages.unshift(total - 1 + '')
pages.push('0')
}

pages is modified but index is not updated. So the "current" page change.

@1uokun
Copy link

1uokun commented Jul 25, 2019

Still exists in iOS whatever version.
Can you tell me what is the action in this step to update in Line 329?

if (this.initialRender && this.state.total > 1) {
this.scrollView.scrollTo({ ...offset, animated: false })
this.initialRender = false
}
this.setState(state)
}

When I change the code,It works as well as Android

- this.setState(state)
+ Platform.OS !== 'ios'&&this.setState(state)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

6 participants