Closed DanielSpindler closed 3 weeks ago
Hi @DanielSpindler,
This was reported by @sarussss here but I haven’t had the time to create a bug report:
Thanks for doing it for me.
Best, David
Thanks alot and no Problem!
Greetings, Daniel
hey guys, running into the same issue with the WheelGesturesPlugin
here's a snippet that sort of fixes this issue:
embalaApi.on('settle', (api: CarouselApi) => {
if (!api) {
return;
}
const { limit, location, scrollTo } = api.internalEngine();
if (location.get() > limit.max) {
scrollTo.index(0, 0);
}
if (location.get() < limit.min) {
scrollTo.index(embalaApi.scrollSnapList().length - 1, 1);
}
});
Ideally it would be nice to reset the momentum early so it never gets to this or take so long to rubber band back.
@DanielSpindler and/or @sarussss,
Can you reproduce this problem in this CodeSandbox?
Hi @davidjerleke I checked, the problem I had before has been resolved, great!
https://codesandbox.io/p/sandbox/embla-carousel-default-react-forked-vcjj84?file=%2Fsrc%2Fjs%2FEmblaCarouselArrowButtons.tsx updated the other CodeSandBox for now @davidjerleke, @sarussss seems like it is not gone, will update it in a live app today and give a feedback after
@DanielSpindler did you try the CodeSandbox in this comment? Because a fix for this has not released yet!
@davidjerleke my fault ive been reading it wrong sorry! do you have a version with "embla-carousel-wheel-gestures": "^8.0.0-rc05" cant reproduce with dragging anymore
@DanielSpindler you can fork the CodeSandbox and add the Wheel Gestures plugin and test it if you want.
@davidjerleke https://codesandbox.io/p/sandbox/bug-785-forked-psk7k8?file=%2Fsrc%2Fjs%2Fembla-carousel.js%3A1857%2C25-1857%2C30 seems to work just fine, cant reproduce anymore
Thanks @sarussss and @DanielSpindler. I'll throw a comment in here once the bug fix has been released.
A bug fix for this will be included in the next release.
@sarussss and @DanielSpindler a bug fix for this was just released in v8.1.4.
Which variants of Embla Carousel are you using?
Steps to reproduce
The bug occurs when I "overscroll/drag" the slides
i got an example sandbox https://codesandbox.io/p/sandbox/embla-carousel-default-react-ww73yq?file=%2Fsrc%2Fjs%2FEmblaCarouselArrowButtons.tsx from the docs and tried it there to reproduce.
https://github.com/davidjerleke/embla-carousel/assets/71325321/e76122c3-c6d6-4d2b-8763-1f00f24ad095
Expected Behavior
Jumping back
Additional Context
I have also tried : Google Chrome Firefox Safari
And also tried to implement a "overscroll" workaround from the issues which sadly jumped around, but not related.
I've searchd the issues and docs throughly and found nothing that could be directly related.
What browsers are you seeing the problem on?
No response
Version
v8.0.0
CodeSandbox
https://codesandbox.io/p/sandbox/embla-carousel-default-react-ww73yq?file=%2Fsrc%2Fjs%2FEmblaCarouselArrowButtons.tsx
Before submitting