react-carousel
react-carousel copied to clipboard
Autoplay without Infinite appears to have unexpected behavior
Describe the bug When the autoplay plugin is used without infinite, two things happen:
- at the end, it just stays in the last slide instead of going back to the first one;
- however, the onChange callback is fired with an out of bounds increment (which causes Dots to wrap back to the beginning, but the carousel remains in the last slide).
To Reproduce Create a carousel with autoplay, but without infinite.
Expected behavior The carousel should either go back to the first slide and keep autoplaying from there, or it should not call onChange with an out of bound value.
Environment System: OS: Windows 10 10.0.19042 CPU: (4) x64 Intel(R) Core(TM) i3-4170 CPU @ 3.70GHz Memory: 8.69 GB / 15.95 GB Binaries: Node: 14.17.0 - C:\Program Files\nodejs\node.EXE Yarn: 1.22.5 - C:\Program Files (x86)\Yarn\bin\yarn.CMD npm: 6.14.13 - C:\Program Files\nodejs\npm.CMD Browsers: Edge: 44.19041.1023.0 Internet Explorer: 11.0.19041.1 Firefox 89.0