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

vue3-carousel not working inside modal #338

Closed
YouSour opened this issue Sep 8, 2023 · 4 comments · Fixed by #434
Closed

vue3-carousel not working inside modal #338

YouSour opened this issue Sep 8, 2023 · 4 comments · Fixed by #434

Comments

@YouSour
Copy link

YouSour commented Sep 8, 2023

hi, I'm trying to implement vue3-carousel inside modal, it doesn't work until i inspect element or resize page it works. what 's problem ? thank in advance

@tjventurini
Copy link

I'm trying to do the same thing. Did you find a solution to this?

@Kenvdb
Copy link

Kenvdb commented Jun 18, 2024

I'm also trying to achieve the same. It works inside the modal, but the mounting of the carousel takes some time, a few seconds, and causes the view to jump.

Any fixes on this?

@Kenvdb
Copy link

Kenvdb commented Jun 20, 2024

I'm also trying to achieve the same. It works inside the modal, but the mounting of the carousel takes some time, a few seconds, and causes the view to jump.

Any fixes on this?

I've did some digging into the code, and I have a feeling this is causing the problem:
setTimeout(() => updateSlideWidth(), 1000)
Line 146 of src/components/Carousel.ts

@Tofandel
Copy link
Contributor

The problem comes from the modal which has either an animation or transition and basically when the modal is mounted with the slider, the computed width is 0

Maybe we could listen for "transitionend" and "animationend" instead of setTimeout

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 a pull request may close this issue.

4 participants