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 Resumption Issue on stopOn events #667

Closed gioAdu closed 6 months ago

gioAdu commented 6 months ago

Bug is related to

Embla Carousel version

Describe the bug

This means that when user interaction or mouse entry occurs (depending on the specific stopOn event), the autoplay feature stops as expected. But, the issue is that autoplay does not restart once the interaction is over or the mouse leaves the area

Steps to reproduce

  1. add any stopOn event to autplay()
  2. trigger the event

Expected behavior

davidjerleke commented 6 months ago

@gioAdu did you set stopOnInteraction to false?

gioAdu commented 6 months ago

Oh, indeed i haven't. setting it to false fixed it. Thank you so much. P.S: any reason it's not false by default ?

davidjerleke commented 6 months ago

@gioAdu I’m glad it worked.

P.S: any reason it's not false by default ?

I’m thinking that if a user interacts with the carousel, it’s probably because the user wants to check out its content. If the carousel starts playing just as the user is checking the carousel content out it might be annoying.

Best, David