davidjerleke / embla-carousel

A lightweight carousel library with fluid motion and great swipe precision.
https://www.embla-carousel.com
MIT License
5.37k stars 164 forks source link

[Bug]: verticle view slider - last slider is not appearing above first slider by default #896

Closed pragadesh-tartlabs closed 3 weeks ago

pragadesh-tartlabs commented 3 weeks ago

Which variants of Embla Carousel are you using?

Steps to reproduce

The bug occurs in verticle slider when I try to display last slider above my first slider with some top margin on load(https://codesandbox.io/p/sandbox/embla-carousel-y-axis-react-forked-4ckh7h?file=%2Fsrc%2Fjs%2Findex.tsx%3A11%2C73) it only visible when i slightly scroll to top, in horizontal view it is working like charm (https://codesandbox.io/p/sandbox/embla-carousel-autoplay-react-forked-pq4pq7?file=%2Fsrc%2Fcss%2Fembla.css%3A15%2C48)

Expected Behavior

verticle slider loop functionality needs to look like horizontal loop slider

Example: image (39)

verticle slider issue (i already made necesary css changes) image image (40)

Additional Context

No response

What browsers are you seeing the problem on?

Chrome

Version

No response

CodeSandbox

https://codesandbox.io/p/sandbox/embla-carousel-y-axis-react-forked-4ckh7h?file=%2Fsrc%2Fjs%2Findex.tsx%3A11%2C73

Before submitting

davidjerleke commented 3 weeks ago

@pragadesh-tartlabs please make your CodeSandbox public. I can’t access it.

davidjerleke commented 3 weeks ago

@pragadesh-tartlabs this is not a bug. Don't add margins to the container (embla__container) because that's the scroll container. Add spacing to the slides instead.