If you have dynamic content {active === index ? `test${index}` : 'test'} then animation onScroll does not work properly. Change it to static test and it works perfectly fine.
Honestly I am not sure if this is by design - that animation does reset when slides resize. Maybe it is just impossible to calculate? Just wanted to let you know and see your thoughts.
Which variants of Embla Carousel are you using?
Steps to reproduce
See example: https://codesandbox.io/p/sandbox/embla-carousel-slides-to-scroll-react-forked-qrgrfs?file=%2Fsrc%2Fjs%2FEmblaCarousel.tsx%3A49%2C61
If you have dynamic content
{active === index ? `test${index}` : 'test'}
then animation onScroll does not work properly. Change it to statictest
and it works perfectly fine.https://github.com/user-attachments/assets/041b943a-bef8-4669-91bd-36bde20f31af
Expected Behavior
Honestly I am not sure if this is by design - that animation does reset when slides resize. Maybe it is just impossible to calculate? Just wanted to let you know and see your thoughts.
What browsers are you seeing the problem on?
Firefox and Chrome.
Version
8.3.0
CodeSandbox
https://codesandbox.io/p/sandbox/embla-carousel-slides-to-scroll-react-forked-qrgrfs?file=%2Fsrc%2Fjs%2FEmblaCarousel.tsx%3A49%2C61
Before submitting