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

Elements don't leave if switched to other tab while animation is ongoing #177

Open
AfzalH opened this issue Aug 22, 2017 · 2 comments
Open
Labels

Comments

@AfzalH
Copy link

AfzalH commented Aug 22, 2017

I was trying to build a rotating/changing text component with this library and noticed this bug.
My component changes the text (removes the previous one and adds a new one) with a timer.

react-flip-bug

The flip move works well as long as I'm on the app tab. However when I go to another tab for a while and come back later, I see (just for a moment) that all those texts are stacked up. It gets fixed almost immediately but that seems like a glitch.

@Pruxis
Copy link

Pruxis commented Sep 27, 2017

I experience the same issue if you change when animation is still ongoing some elements are removed or even added.

@mreishus
Copy link

I believe this is due to the use of requestAnimationFrame, which is paused when a tab is in the background.

https://developer.mozilla.org/en-US/docs/Web/API/window/requestAnimationFrame

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

No branches or pull requests

4 participants