I build a frontend app for managing time. Everything work but when I am switching to another tab (without closing the app tab) the stopwatch is stopped. This is the website: https://tasks-time-manager.netlify.app/ And this is more or less what the code does:
playBtn.addEventListener('click', playBtnClickedHandler);
function playBtnClickedHandler(this: HTMLButtonElement) {
setTimeout(()=>{
//Update the UI by 10 miliseconds
},10)
}
How can I make the app work when the tab is not currently displayed?