-
Notifications
You must be signed in to change notification settings - Fork 3.6k
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
Carousel is not correctly sliding from first index to last in 'prev' direction #5319
Comments
I can repro this in the code sandbox example, but not the RB site. Looks like the react-bootstrap/src/Carousel.tsx Lines 254 to 259 in 26ee2b9
|
Interesting. I currently run my site wrapped within StrictMode so that might explain the source of the issue. Is there an easy way to make this component compatible with StrictMode? |
Unfortunately no. Might have a fix here, just testing now. |
* fix: Fix clearing nextDirectionRef in <Carousel> Fixes #5319 * fix
When on the first slide and triggering a slide event in 'prev' direction, the carousel slides to the correct element, the last slide, but with a 'next' animation. This can, for example, be observed in the documentation here:
https://react-bootstrap.github.io/components/carousel/#example
The effect is most apparent when repeatedly sliding to the previous slide. The transition from first to last is simply off.
For comparison the expected behavior from the Bootstrap carousel:
https://getbootstrap.com/docs/4.0/components/carousel/#with-controls
Unfortunately my knowledge in this area is so limited that I can't even find the event handler responsible for the actual transition, so I don't actually know where to look for this, but maybe one of you guys know why this is happening.
I'm using v1.2.2. Here is an example (not sure if it's the same version) https://codesandbox.io/s/runtime-grass-l2cg4?file=/package.json
related to #3654
The text was updated successfully, but these errors were encountered: