intellidev1991/react-native-image-slider-box

Circle Loop Bug

lirda394 opened this issue · 6 comments

Hello,
I have been trying to implement the circleloop prop and I have been getting some weird results. I put a link to the screen recording that captures the issue. The issue is that once the slider gets to the last image it slides left to the first image then it snaps back all the way to the right.

I don't want the left image to show and I have seen people demoing the slider and they do not have this problem.

Screen Recording-
https://user-images.githubusercontent.com/17896518/219474921-a452f169-369e-4f5d-999a-eaa76d0623e3.mov

Slider Code(within a safeareaview):

<SliderBox images={images}
onCurrentImagePressed={() => navigation.navigate("SeriesPage")}
autoplay={true}
autoplayInterval={1000}
circleLoop/>

styles.banner:
banner: {
marginBottom: 10
}

Images Code:
const images = [
"https://storageconverge.blob.core.windows.net/pictures/jay-mantri-TFyi0QOx08c-unsplash.jpg",
"https://storageconverge.blob.core.windows.net/pictures/eberhard-grossgasteiger-y2azHvupCVo-unsplash.jpg",
"https://storageconverge.blob.core.windows.net/pictures/qingbao-meng-01_igFr7hd4-unsplash.jpg",
]

I'm facing the same issue.

facing same issue the slider scrolls back to the first instead of playing the first directly

same issue

having same issue here too, anyone found solution?

adey69 commented

@warrence I couldn't find the exact issue but I believe it had something to do with scroll animation. I fixed it by creating a patch for the package which disables the animation prop of the scroll function.
Following is a repo with minimal code with the bug fix:
https://github.com/adey69/react-native-slider-fix
Following is the link to the patch I created:
https://github.com/adey69/react-native-slider-fix/blob/main/patches/react-native-image-slider-box%2B2.0.7.patch

Preview after the fix:

705888e4-d1ab-4170-b4fa-54a09f2b724b.mp4

#187

I solve it here