Hi David! Thank you for your work on embla-carousel, it's been a joy to use so far in my project :)
Is it possible to move one slide at a time when slidesToScroll is set to 2 or more? This is what I'm asking for, visualized:
Expected:

What's happening:

Sandbox: https://codesandbox.io/s/embla-carousel-default-react-forked-scfoz?file=/src/js/EmblaCarousel.js
Hi Patrick (@patrickhuang94),
Thank you for your question. Based on your description, I think you're looking for the align option rather than slidesToScroll. Because the purpose of slidesToScroll is to merge slides into the given number and make them act as if it was a single slide. Let's take slidesToScroll: 2 as an example:

As you can see, Embla treats every 2 slides as if it was a single slide behind the scenes. In order to achieve what you want, you'll have to do the following:
align: 'start' because we want the slides to align to the left edge of the viewport.containScroll: 'trimSnaps' to trim any leading/trailing scroll space.slidesToScroll option to its default value which is 1.Take a look at this CodeSandbox I created for you and let me know if it helps.
Best,
David
@davidcetinkaya this is exactly what I was looking for. Thank you for the breakdown!
You鈥檙e welcome @patrickhuang94. Enjoy!
Most helpful comment
Hi Patrick (@patrickhuang94),
Thank you for your question. Based on your description, I think you're looking for the
alignoption rather thanslidesToScroll. Because the purpose ofslidesToScrollis to merge slides into the given number and make them act as if it was a single slide. Let's takeslidesToScroll: 2as an example:As you can see, Embla treats every 2 slides as if it was a single slide behind the scenes. In order to achieve what you want, you'll have to do the following:
align: 'start'because we want the slides to align to the left edge of the viewport.containScroll: 'trimSnaps'to trim any leading/trailing scroll space.slidesToScrolloption to its default value which is1.Take a look at this CodeSandbox I created for you and let me know if it helps.
Best,
David