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

Leaving the tab doesn't pause the timeline when calling timeline.pause on blur event #721

Open
sachaandre opened this issue Sep 18, 2020 · 4 comments

Comments

@sachaandre
Copy link

Describe the bug
As the title says : Leaving the tab doesn't pause the timeline when calling timeline.pause() on blur event

To Reproduce
I've made a js fiddle here to reproduce the bug : https://jsfiddle.net/mjh70dsa/27/

Expected behavior
When I'm leaving the tab, the method timeline.pause() is triggered.

Desktop (please complete the following information):

  • OS: Windows 10
  • Browser : tested on Chrome v.85 / Edge v.85

Thanks in advance ;) !

@sachaandre
Copy link
Author

Addendum : The timeline.pause is fired when the focus is lost, when i click for exemple on the volume bar of windows.
The bug seems to be specific when I'm leaving the current tab

@SiddharthSham
Copy link

I'm unable to reproduce the bug on Chrome v85 / Windows 10. But a few points to note:

  1. To observe tab visibility, there exists the Page Visibility API. https://developer.mozilla.org/en-US/docs/Web/API/Page_Visibility_API

  2. Anime internally uses requestAnimationFrame to run the animations. According to the spec, the callbacks will not fire if the page is not visible. So you shouldn't have to observe page visibility at all.

@juliangarnier
Copy link
Owner

I think #701 might fix this.

@sachaandre
Copy link
Author

Hello @juliangarnier
The PR totally fixed what i was looking for, thanks a lot !

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants