It annoys me too, please upvote issue Runtime stops executing when switching tabs · Issue #458 · observablehq/feedback · GitHub
It’s not a general JS issue, it’s the way the reactive runtime is driven by requestAnimationFrame, it could be changed, potentially.