React-native-swiper: scrollBy scroll to wrong position

Created on 7 Dec 2017  路  5Comments  路  Source: leecade/react-native-swiper

Which OS ?

It happens on Android and ios

Version 1.

Which versions are you using:

  • react-native-swiper v1.5.10
  • react-native v0.48.0

Expected behaviour

scroll to correct position

Actual behaviour

scroll to wrong position

How to reproduce it>

When I use scrollBy this function, it's a little bit different than I expected. I expect it will jump to the specified location, but it didn't. I used a set of buttons to control the rolling position of the plug-in called swiper , but when I first used, it is normal to jump, but the second time in the beginning, it is called the scrollToIndex out of range: 16 vs 10 mistakes, then a set of buttons of mine also are unable to click , in other words, the bug called scrollBy causes my button click failed, could you tell me how to solve this situation.
-

Most helpful comment

@ChaseChan I think scrollBy function must receive "steps number" not "location number". so you can go throw swiper slides step by step or two steps and so on.

All 5 comments

@ChaseChan I think scrollBy function must receive "steps number" not "location number". so you can go throw swiper slides step by step or two steps and so on.

How do you use scrollBy?

@nirpeled add ref={"mySlide"} and use this.refs.mySlide.scrollBy(1,true);

Thanks @taisaotaokhoc

Any updates on this ?

Was this page helpful?
0 / 5 - 0 ratings

Related issues

Liqiankun picture Liqiankun  路  3Comments

ghost picture ghost  路  3Comments

commit-master picture commit-master  路  3Comments

kylehagler picture kylehagler  路  3Comments

JonasOmdal picture JonasOmdal  路  3Comments