Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Bug]: Slide hanging if overdragged/scrolled #785

Open
4 of 14 tasks
DanielSpindler opened this issue Mar 5, 2024 · 11 comments · May be fixed by #883
Open
4 of 14 tasks

[Bug]: Slide hanging if overdragged/scrolled #785

DanielSpindler opened this issue Mar 5, 2024 · 11 comments · May be fixed by #883
Assignees
Labels
bug Something isn't working core This is related to the core package

Comments

@DanielSpindler
Copy link

DanielSpindler commented Mar 5, 2024

Which variants of Embla Carousel are you using?

  • embla-carousel (Core)
  • embla-carousel-react
  • embla-carousel-vue
  • embla-carousel-svelte
  • embla-carousel-autoplay
  • embla-carousel-auto-scroll
  • embla-carousel-solid
  • embla-carousel-auto-height
  • embla-carousel-class-names
  • embla-carousel-docs (Documentation)
  • embla-carousel-docs (Generator)

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.

Bildschirmaufnahme.2024-03-05.um.18.01.08-1.mov

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

  • I've made research efforts and searched the documentation
  • I've searched for existing issues
  • I agree to follow this project's Contributing Guidelines for bug reports
@DanielSpindler DanielSpindler added the bug Something isn't working label Mar 5, 2024
@davidjerleke
Copy link
Owner

davidjerleke commented Mar 5, 2024

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

@davidjerleke davidjerleke added the core This is related to the core package label Mar 5, 2024
@DanielSpindler
Copy link
Author

Thanks alot and no Problem!

Greetings,
Daniel

@chiumax
Copy link

chiumax commented Apr 10, 2024

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.

Repository owner deleted a comment from tayteboss May 19, 2024
davidjerleke added a commit that referenced this issue May 19, 2024
@davidjerleke davidjerleke linked a pull request May 19, 2024 that will close this issue
@davidjerleke
Copy link
Owner

@DanielSpindler and/or @sarussss,

Can you reproduce this problem in this CodeSandbox?

davidjerleke added a commit that referenced this issue May 20, 2024
@sarussss
Copy link
Contributor

Hi @davidjerleke
I checked, the problem I had before has been resolved, great!

@DanielSpindler
Copy link
Author

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

@davidjerleke
Copy link
Owner

davidjerleke commented May 21, 2024

@DanielSpindler did you try the CodeSandbox in this comment? Because a fix for this has not released yet!

@DanielSpindler
Copy link
Author

@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

@davidjerleke
Copy link
Owner

davidjerleke commented May 21, 2024

@DanielSpindler you can fork the CodeSandbox and add the Wheel Gestures plugin and test it if you want.

@DanielSpindler
Copy link
Author

@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

@davidjerleke
Copy link
Owner

Thanks @sarussss and @DanielSpindler. I'll throw a comment in here once the bug fix has been released.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working core This is related to the core package
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants