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

Autoplay resumes when user changes tab #599

Closed
Tracked by #321
matthewdixon opened this issue Oct 16, 2023 · 4 comments · Fixed by #620
Closed
Tracked by #321

Autoplay resumes when user changes tab #599

matthewdixon opened this issue Oct 16, 2023 · 4 comments · Fixed by #620
Labels
bug Something isn't working resolved This issue is resolved

Comments

@matthewdixon
Copy link

Big fan of Embla here 👋 Thanks so much for your fantastic work on this framework thus far, I love working with it!

Bug is related to

embla-carousel-autoplay

Embla Carousel version

7.1.0

Describe the bug

On the click of a button I am stopping autoplay with emblaApi.plugins().autoplay.stop(). Autoplay stops but only while the user remains within the current tab. When swapping tab then returning to the one with the previously stopped carousel, autoplay resumes.

CodeSandbox

https://codesandbox.io/s/tyh5r4

Steps to reproduce

  1. Change slide by clicking any of the buttons, ie. next/prev or dots
  2. Open a new browser tab or switch to one already open
  3. Return to tab with carousel, autoplay will restart

Expected behaviour

Autoplay to remain stopped when the user changes then returns to the tab.

Additional context

I don't believe this to be the intended functionality as when changing slide by clicking/dragging autoplay stops as expected and does not restart after changing tab.

@matthewdixon matthewdixon added the bug Something isn't working label Oct 16, 2023
@davidjerleke
Copy link
Owner

Hi @matthewdixon,

I will try to reproduce this when I get the chance. Thank you for a complete bug report with a CodeSandbox. This is as you already mentioned, not expected behavior.

Version 8.0.0 is just around the corner so I won’t be doing any bug fixes for v7 anymore. The bug fix will be released with v8. I hope you don’t have any objections migrating to v8.

I’ll let you know when I’ve investigated this further.

Best,
David

@davidjerleke davidjerleke mentioned this issue Nov 2, 2023
37 tasks
davidjerleke added a commit that referenced this issue Nov 3, 2023
davidjerleke added a commit that referenced this issue Nov 10, 2023
@davidjerleke davidjerleke added the resolved This issue is resolved label Nov 10, 2023
@matthewdixon
Copy link
Author

Hi @davidjerleke, apologies for the severely delayed response!! Great to hear you've rolled out a fix for v8, I've just had a play and can confirm this now works as expected 🎉

I had a look at the latest RC when you first replied but noticed the carousel wasn't as responsive so decided to come back to it when v8 had been released. Now it has and I've tested it, I still find it's not as responsive as v7 with what appears to be a slight lag between click/drag interactions and carousel movement. I love how snappy it was previously so this is a shame 😕 Just wondering if this was an intentional change?

@davidjerleke
Copy link
Owner

I still find it's not as responsive as v7 with what appears to be a slight lag between click/drag interactions and carousel movement. I love how snappy it was previously so this is a shame 😕 Just wondering if this was an intentional change?

Hi @matthewdixon,

I don't understand what you mean? I don't experience any lag at all. Embla v8 input is always responsive for me. For me, clicks happen instantly and drag interactions start instantly on pointer down and as soon as I start dragging the carousel reacts to it, even if it was in motion before the pointer down. But maybe I'm misunderstanding what you mean.

@matthewdixon
Copy link
Author

Hi @davidjerleke, apologies for another outrageously late reply 😅

No you've understood correctly: it was only minimal but I definitely experienced a delay between interaction and response (I remember it being particularly noticeable on drag). I should have a chance to come back to this next week so I'll see if I can demo it to you somehow, might have to try capturing my screen if you're not seeing it your end as that suggests hardware might be a factor.

I'll report back!

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

Successfully merging a pull request may close this issue.

2 participants