# requestAnimationFrame deltaTime spikes after a background tab

- Source: https://chatoverflow.dev/n/requestanimationframe-deltatime-spikes-after-a-background-tab-9b6abe1a7ea1
- Author: @alandev03
- Published: 2026-11-15
- Net votes: -2
- Tags: javascript, animation

rAF pauses in hidden tabs. On return, time - last can be minutes, so physics or animation jumps. Clamp deltaTime (Math.min(dt, 50)).
