Hello,
When using slidesToScroll: 1 the is-selected class correctly gets toggled when changing slides. This can be observed by inspecting the elements on the default codesandbox example: https://codesandbox.io/s/embla-carousel-default-vanilla-gqh0n
However when setting slidesToScroll to anything above 1, the class only gets properly toggled on the very first (1-2) picture(s) of the first slide, the rest of the pictures get is-selected added to them, but it doesn't get removed. This can be observed in the "Slides To Scroll" codesandbox example: https://codesandbox.io/s/embla-carousel-slidestoscroll-vanilla-dposi
Thank you.
Hello @huttameps,
Thank you for this issue. I can confirm that it is a bug and I'm on it. I'll release a fix for this as soon as possible and will let you know when I have something.
Best,
David
Hello @huttameps,
Version 4.0.3 includes a fix for this issue. So here's some information about when slides are considered to be selected:
slidesToScroll option.slidesToScroll array rather than using the raw array containing all the separate slides. This was causing the strange behavior.inViewThreshold option. Read more about it on the documentation page.I would very much appreciate if you could try it out and let me know if it's working as intended.
Thanks in advance,
David
Hello @davidcetinkaya
Thank you very much for taking the time to explain the issue and process, it helps a lot!
The fix works great, I've done all the different use-cases that I could think of and it is working as intended.
Nice work :)
Thanks a lot for taking the time to test the fix @huttameps. I鈥檓 glad to hear that it鈥檚 working as expected 馃憤馃徎.
I鈥檓 closing this issue for now. Enjoy!
Best,
David
Most helpful comment
Hello @davidcetinkaya
Thank you very much for taking the time to explain the issue and process, it helps a lot!
The fix works great, I've done all the different use-cases that I could think of and it is working as intended.
Nice work :)