Open sachaandre opened 4 years ago
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
I'm unable to reproduce the bug on Chrome v85 / Windows 10. But a few points to note:
To observe tab visibility, there exists the Page Visibility API. https://developer.mozilla.org/en-US/docs/Web/API/Page_Visibility_API
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.
I think #701 might fix this.
Hello @juliangarnier The PR totally fixed what i was looking for, thanks a lot !
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):
Thanks in advance ;) !