vydimitrov / react-countdown-circle-timer

Lightweight React/React Native countdown timer component with color and progress animation based on SVG

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

onUpdate doesn't work when page/tab in background chrome

ManabBala opened this issue · comments

i am trying to update the page title with the remaining time duration. but when i open another tab means put my current timer tab in background my onUpdate function stop updating title of timer page. please help me...

Hey @ManabBala, well that is a complicated one since the timer is using requestAnimationFrame to measure elapsed time, which is suspended when the browser tab is not active. One way to go around it is to detect when the tab is not active, pause the timer and start measuring the elapsed time using setIntertval, which should run even when the tab is not active. But all of this will require custom logic that is not built in the timer.

Hey @ManabBala, have you managed to find a solution for this problem?

Closing this due to inactivity.