react-responsive-carousel: infiniteLoop is broken since 3.2.22
Describe the bug
The infiniteLoop
option does not work anymore with version 3.2.22. The carousel does not go in a loop but jumps from the end to the start or from start to end.
To Reproduce Install version 3.2.22 and create a carousel with at least 2 slides. Go to the last slide and then one more. It should go the first slide in a loop but instead it jumps back to the first slide.
Expected behavior It should go in a loop.
Additional context
The infiniteLoop
option works as expected with 3.2.21. Installing this exact version “fixes” it. The weird thing is that if you install the newest version and then comment out the only change made to the code (https://github.com/leandrowd/react-responsive-carousel/commit/8cc7480c055d5824a23708a003be0941a364e8a2) it does not fix the problem. So this change does not seem to cause the bug. Maybe the build process changed and the bug was introduced there?
Video from the storybook
You can see the bug in the storybook demo. As you can see the infiniteLoop
option is enabled but it just jumps back. I would like to show the difference to the previous version but i don’t know if thats possible in storybooks.
I would help I would like to contribute but i don’t know what else could be the problem to this instead of the only change made to the code and I don’t know about your build process. Maybe you find the problem or can give me more info where to look.
About this issue
- Original URL
- State: open
- Created 2 years ago
- Reactions: 17
- Comments: 16
New update investigation. Found out (I may be wrong in details, but the general picture is clear) that there was split refactoring (Carousel.tsx -> index.tsx,animation.ts,…) after 3.2.15, where infiniteloop already stopped working. But. No one noticed this, because the new files were “covered” by the old ( repo: https://www.npmjs.com/package/react-responsive-carousel?activeTab=versions ), not deleted, obsolete working code (the original Carousel.js, Carousel.tsx files were not deleted). In installation 3.2.22, the Carousel.js file was removed because in theory it was not needed, and we started using new but glitchy (infiniteloop does not work) code.
Thanks for sharing this issue! For now, I’ll revert to 3.2.21 👍
I discovered the following: version 3.2.21 (npm install react-responsive-carousel@3.2.21 vs npm install react-responsive-carousel@3.2.22) has no file react-responsive-carousel\lib\js\components\Carousel.js , if you copy the file from version 3.2.21 to 3.2.22, the infinite loop starts working correctly.
same issue i am facing reverted back to version 3.2.21 and now its working fine
The issue is not resolved.