gridsome/gridsome.org

Homepage heading animation running in background/bugged upon reentering

Erbenos opened this issue · 1 comments

Reproduction link
https://gridsome.org/

Steps to reproduce

  1. Open https://gridsome.org/
  2. Keep https://gridsome.org/ opened, in same browser window switch to different tab
  3. Wait a while
  4. Re-enter previously opened https://gridsome.org/ tab

What is expected ?
Animation will continue playing as before

What is actually happening?
Since the animation is using setInterval only:

  • it keeps running even when tab is not active
  • it causes weird behaviour when reentering - as if multiple animation iterations were stacked on top of each other... only for first iteration upon reentering

Additional comments?
Checked on Chrome.

Resolved in #323