react-native-snap-carousel icon indicating copy to clipboard operation
react-native-snap-carousel copied to clipboard

Got error with firstItem in the first time swipe

Open hienpvptit opened this issue 2 years ago • 0 comments

I have 4 items [0, 1, 2, 3] And I set the firstItem is 3. In the first time, correctly with the default active is 3. But when I tried to snap to the 0, NO trigger from onSnapToItem. If I snap to 1 OR 2 from 3. I see HAVE trigger from onSnapToItem.

Example: <Carousel data={[0, 1, 2, 3]} renderItem={renderItem} firstItem={3} onSnapToItem={(slideIndex) => { console.log(slideIndex) }} useScrollView enableMomentum />

I found this from Carousel.js line 1047 image

It need be changed to this._scrollEndOffset = this._scrollOffsetRef; instead of this._scrollEndOffset = this._currentContentOffset;

Anyone have same issue with me, and do you think my understanding is correct?

hienpvptit avatar Nov 08 '22 07:11 hienpvptit