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

#525: Fix indicator click not resetting autoplay #561

Conversation

renancleyson-dev
Copy link
Contributor

Fixes #525.

In the issue, there's a workaround by calling the resetAutoPlay with the Carousel ref on the onChange callback, but it can simply be solved by resetting the autoplay on the changeItem method, which also prevents an unnecessary reset since the onChange callback it's not only called by the indicators.

Before

The image changes right after changing the slide through the indicators

After

The image don't autoplay right after a click on some indicator

@renancleyson-dev renancleyson-dev force-pushed the indicator-select-not-reset-auto-play branch from 2d0c779 to 5b48769 Compare February 16, 2021 13:11
@renancleyson-dev renancleyson-dev force-pushed the indicator-select-not-reset-auto-play branch from 5b48769 to 2f8b575 Compare February 16, 2021 13:25
@leandrowd
Copy link
Owner

Thanks for the contribution but after reviewing your change I realised that the fix should be to not call selectItem but instead moveTo.

moveTo will take care of reseting auto play and other things.

It needs to be changed on handleClickThumb and changeItem.

Could you make this change?

@renancleyson-dev
Copy link
Contributor Author

Done!

@leandrowd leandrowd merged commit 8706a7b into leandrowd:master Mar 18, 2021
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.

Timer does not reset when the carousel image is changed through indicators
2 participants