-
-
Notifications
You must be signed in to change notification settings - Fork 1.9k
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 transition breaks when rendered inside a Modal #2041
Comments
Hi @gigobyte, Modal animation causes this issue. When modal is opened, embla carousel is init before the animation ends which, I suppose, causes embla to calculate slides offset incorrectly. It is fixable if you call I've opened a discussion about it in embla repository, let's see if we can fix that – davidjerleke/embla-carousel#346 |
Fixed in 5.1.5, will require usage of |
Thanks! |
Hello everyone, Just wanted to let you know that I released stable This means that Best, |
What package has an issue
@mantine/carousel
Describe the bug
When rendering a Carousel inside a Modal, transitioning to the next slide adds more pixels to
translate3d
than necessary, in fact it consistently adds 10% of the slide width on top of the desired transition pixels.This problem is not reproducible if the Carousel is not rendered inside a Modal OR if the Modal is opened on first render (which can be seen in the demo).
What version of @mantine/hooks page do you have in package.json?
5.0.3
If possible, please include a link to a codesandbox with the reproduced problem
https://codesandbox.io/s/hungry-grass-jknqq4?file=%2Fsrc%2FApp.js
Do you know how to fix the issue
A temporary fix for me right now is to not render anything when the modal is not opened, like so:
Are you willing to participate in fixing this issue and create a pull request with the fix
Yes
Possible fix
No response
The text was updated successfully, but these errors were encountered: