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]: When using the wheel gesture to swipe the carousel, for the first slide and the last slide, there are excessive blank space. #819

Closed xnslx closed 2 months ago

xnslx commented 2 months ago

Which variants of Embla Carousel are you using?

Steps to reproduce

I am using the wheel gesture plugin combined with the embla core plugin, I noticed that for using the wheel gesture, there is excessive blank space if you swipe the first slide and the last slide in the wrong direction.

https://github.com/davidjerleke/embla-carousel/assets/51500554/60f90c5d-2910-4c99-a3a0-f04385a91983

Expected Behavior

I am wondering that is it possible to make, for the first slide to lock the left side which should not be swipped by the user and also for the last slide which lock the right side. I hope to make the carousel feel sharper, right now it feels quite floppy. Using Zara as an example.

Additional Context

I have also tried...

What browsers are you seeing the problem on?

Chrome

Version

No response

CodeSandbox

https://codesandbox.io/p/devbox/github/xiel/embla-carousel-wheel-gestures/tree/master/docs/react

Before submitting

davidjerleke commented 2 months ago

@xnslx please move this question to discussions because this is expected behavior and therefore not a bug. Choose ask for help here:

IMG_7967

xnslx commented 2 months ago

Hey @davidjerleke After digging this issue a little bit, I think I find a similar issue that opened by others long time ago and you answer here, https://github.com/davidjerleke/embla-carousel/issues/42#issuecomment-895850425 Thank you so much. I am gonna move this to discussion. Thank you!🙏