react-image-gallery
react-image-gallery copied to clipboard
Fix auto play direction in 2 slides
This pr has fixed(not sure if it's a fix) the swipe direction when there're 2 slides with infinite enabled.
Before this PR, if there're 2 slides only, with infinite
& autoPlay
enabled, when playing from last slide to the first slide, the direction would be from RIGHT to LEFT:
This seems to be correct, but remember when we made slide imperatively from navigation, it works as 'infinite' indeed: the new slide always comes from the right side:
I think the swipe direction(or behaviour) should be same exactly whatever it's from auto play or user gesture? And this PR changes the behaviour in previous case to make it always works like 'infinite':
This PR doesnot make great changes, in opposite, I'm just putting the slideToIndexWithStyleReset
into the slideToIndex
handler, as all the slide changes goes through here.