-
-
Notifications
You must be signed in to change notification settings - Fork 193
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
[Bug]: useEmblaCarousel
initializes Embla with stale options in certain cases
#980
Comments
I will open PR shortly. |
@lesha1201 why aren’t you using the breakpoints option? |
@davidjerleke Didn't know about However, the issue can happen in other cases where
|
@lesha1201 thanks. I will look into this when possible. |
@lesha1201 thanks. Your PR solves the problem. |
@lesha1201 this bug fix was released in |
Which variants of Embla Carousel are you using?
Steps to reproduce
The issues happens when
useEmblaCarousel
createsEmblaCarousel
(emblaApi
) at the same time whenoptions
have changed. It happens because ofuseEffect
orderHere is an example: https://codesandbox.io/p/devbox/embla-carousel-stale-options-dw88yj
If you open the example on small viewport (less than 1024px in width) then the issue appears and Embla Carousel wrongly initialized with
watchDrag: false
instead ofwatchDrag: true
.Desktop.2024.08.21.-.17.57.47.01.mp4
Expected Behavior
Embla Carousel should be initialized with the latest options.
Additional Context
I have also tried...
What browsers are you seeing the problem on?
All browsers
Version
v8.2.0
CodeSandbox
https://codesandbox.io/p/devbox/embla-carousel-stale-options-dw88yj
Before submitting
The text was updated successfully, but these errors were encountered: