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

Carousel works perfectly, but not inside a modal #404

Open
Novizh opened this issue Aug 24, 2023 · 1 comment
Open

Carousel works perfectly, but not inside a modal #404

Novizh opened this issue Aug 24, 2023 · 1 comment

Comments

@Novizh
Copy link

Novizh commented Aug 24, 2023

Hello @YIZHUANG, I've been using this carousel for my entire project and it works fine.
However, there's a new feature that requires me to display the carousel inside a modal.

Prerequisites
react-multi-carousel with Custom Dots
Bootstrap

Describe the bug
Let's say it's a product details page, which already has react-multi-carousel working perfectly fine, the a modal will open if an image is being clicked, which will render the exact same carousel only with bigger images inside the carousel.

To Reproduce
Steps to reproduce the behavior:

  1. Copy and paste a perfectly working react-multi-carousel code, into a modal component, and render it in the same page.
  2. Add functionality to open said modal
  3. Wait for the modal to open

Expected behavior
The modal is opened and the exact same carousel is rendered both inside the modal and behind the backdrop

Screenshots
Instead I got this empty carousel
Screenshot from 2023-08-24 14-04-42
Here's what's inside the element
Screenshot from 2023-08-24 14 11 12

Please advise, been working this issue for hours

Reproduction
You can try this case on this sandbox
https://codesandbox.io/p/sandbox/twilight-lake-skdwtn

@Novizh Novizh changed the title Carousel did not work inside a modal Carousel works perfectly, but not inside a modal Aug 24, 2023
@VigilioYonatan
Copy link

any solution?

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

No branches or pull requests

2 participants