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

Ghosting while tab is not focused #226

Open
jesper-bylund opened this issue May 7, 2018 · 1 comment
Open

Ghosting while tab is not focused #226

jesper-bylund opened this issue May 7, 2018 · 1 comment

Comments

@jesper-bylund
Copy link

I'm building a table that updates with new data constantly, basically a dashboard. Flip-move works really well while I'm watching the Tab. But if I click away to another tab for a few minutes animations seem to stop ending, so I get an unresponsive tab with lots and lots of ghosting.

Anyone have a clue as to what's going on?

screen shot 2018-05-07 at 10 00 25

@joshwcomeau
Copy link
Owner

Ah, I really dropped the ball on this one! Sorry for the monumental delay :(

Chrome throttles animations for tabs not in focus, and it sounds like it's not playing well with this library.

What exactly do you mean by "ghosting"?

Perhaps one solution would be to delay updating the DOM until the tab is focused. I found this SO answer which seems like a very similar story: https://stackoverflow.com/questions/7389328/detect-if-browser-tab-has-focus/7389429

I know this is almost 2 months old now, so you've likely already solved this problem, but on the off-chance it's helpful, I would suggest adding some listeners for when the window is focused/blurred, and to avoid updating the component state while it's blurred (you can still make the async data requests, but just hold the data in some transient place, and setState when focus is returned)

Happy to elaborate if needed!

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

2 participants