I have TouchableOpacity child Items within the Carousel component - where the onPress on the TouchableOpacity items work fine.
However, when tapping/clicking on the last item, it will cause the carousel to snap back to the second last item.
Has anyone else experienced the same issue?
// Example
render() {
const slides = this.props.items.map((entry, index) => {
return (
<TouchableOpacity
onPress={() => { this.props.onPress() }}
key={`entry-${index}`}
>
<View>
<Image
style={styles.imageContainer}
source={entry.illustration}
/>
</View>
</TouchableOpacity>
);
});
return(
<Carousel
{...this.props}
ref={(carousel) => { this._carousel = carousel; }}
showsHorizontalScrollIndicator={false}
snapOnAndroid={true}
removeClippedSubviews={false}
sliderWidth={sliderWidth}
itemWidth={itemWidth}
slideStyle = {0}
onSnapToItem = {(index) => { this.props.onSnapToItem() }}
>
{ slides }
</Carousel>
)
}
same happend to me
Same here.
Ok, seems like a top priority :-) I'll try to reproduce and fix it shortly.
@pratomchaip @Sky891028 @XavierColombel I've released version 2.1.1 that should fix this issue. Can you try it and let me know how it goes?
2.1.1 fixed it. Great work @bd-arc
@bd-arc Wow, it was fast! Great job! I don't know if you still working on it but the loop mode (without autoplay) would be really appreciated. 馃槈
@XavierColombel I know since I'd like to use it myself ;)
We're still working on it but it's really complicated and we didn't have enough time to tackle it recently. Stay tuned though!
I am using 2.1.1 and it still has weird scroll behaviour happening when i tap on the last item. So it seems that some cases might not be fixed.
It happens when sliderWidth is less than screen width and containerCustomStyle has paddings to fill side paddings up to "fill the screen"
@rogerkerse Hi! Would you mind sharing your Carousel implementation as well as the relevant styles? This would help me reproduce the issue ;-)
@bd-arc Unfortunately I don't have the old code :(
@rogerkerse Would you mind creating a simple test case? Because I am not able to reproduce the issue on my side...
Most helpful comment
Ok, seems like a top priority :-) I'll try to reproduce and fix it shortly.