Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix auto play direction in 2 slides #786

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

linbudu599
Copy link

@linbudu599 linbudu599 commented Feb 1, 2024

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:

2024-02-01 20 58 10

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:

2024-02-01 21 00 39

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':

2024-02-01 21 03 47

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.

@xiaolin xiaolin self-assigned this Feb 20, 2024
@xiaolin xiaolin self-requested a review February 20, 2024 23:20
@xiaolin xiaolin assigned linbudu599 and unassigned xiaolin and linbudu599 Feb 20, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants