davidjerleke / embla-carousel

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

Autoplay resumes before mouse has left the carousel container with stopOnMouseEnter set to true #644

Closed tombryden closed 6 months ago

tombryden commented 7 months ago

Bug is related to

Embla Carousel version

Describe the bug

With stopOnMouseEnter set to true and stopOnInteraction set to false, dragging the carousel without the mouse leaving the carousel container causes autoplay to begin scrolling despite the mouse not leaving the carousel container. Here is a gif showing this behaviour

CodeSandbox

https://codesandbox.io/p/github/tombryden/embla-autoplay-bug/mouse-enter-bug

Steps to reproduce

  1. Hover mouse over slide
  2. Observe that autoplay stops while hovered
  3. Drag slide to move to another slide
  4. Observe that autoplay starts, despite mouse not leaving carousel

Expected behavior

Autoplay should not restart after drag interaction with stopOnMouseEnter set to true

davidjerleke commented 7 months ago

Thanks @tombryden for a complete bug report. I'll look into it when I get the chance.

Best, David

davidjerleke commented 6 months ago

Hi @tombryden,

Would you mind testing the following CodeSandbox and see if it behaves as expected now? Please let me know if you intend to test it or not so you don't leave me hanging. Thanks!

Best, David

tombryden commented 6 months ago

Hi @davidjerleke - just tested now, seems to be working as expected. Thanks!

davidjerleke commented 6 months ago

@tombryden thank you for confirming 👍🏻.

Cheers, David

davidjerleke commented 6 months ago

@tombryden a bug fix for this was just released in v8.0.0-rc16.