vydimitrov / react-countdown-circle-timer

Lightweight React/React Native countdown timer component with color and progress animation based on SVG
MIT License
692 stars 87 forks source link

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

Closed ManabBala closed 2 years ago

ManabBala commented 2 years ago

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...

vydimitrov commented 2 years ago

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.

vydimitrov commented 2 years ago

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

vydimitrov commented 2 years ago

Closing this due to inactivity.