rosskevin/ifvisible

Throttling prevents wakeup event when rapidly switching tabs

Closed this issue · 2 comments

Hi,

Thanks for forking and maintaining this library!

I have discovered an issue when rapidly switching to a different tab and back again. In this case the wakeup event is not fired. This is caused by the throttling of events. Lowering the throttle duration does not seem to help, at least during my testing. The timeout callback takes at least 100ms to fire, even with a duration of 1ms.

I was wondering whether the visibility change event actually needs throttling? It will never be fired as often as the other events.

I was wondering whether the visibility change event actually needs throttling? It will never be fired as often as the other events.

You are right, it probably doesn't need throttling. PR's are welcome!

🚀 Issue was released in v3.3.5 🚀