fix(studio): ensure GSAP timeline stays paused after seek

Call tl.pause() both before AND after tl.seek() in the adapter.
GSAP's seek() can reactivate a timeline depending on internal state;
the second pause() guarantees it stays frozen at the seeked position.
This commit is contained in:
Miguel Ángel
2026-05-21 21:26:32 -04:00
parent 7b1aa23039
commit 3e7b464b3b
2 changed files with 3 additions and 11 deletions
@@ -135,8 +135,10 @@ export function wrapTimeline(tl: TimelineLike): PlaybackAdapter {
play: () => tl.play(),
pause: () => tl.pause(),
seek: (t, options) => {
if (!options?.keepPlaying) tl.pause();
const shouldPause = !options?.keepPlaying;
if (shouldPause) tl.pause();
tl.seek(t);
if (shouldPause) tl.pause();
},
getTime: () => tl.time(),
getDuration: () => tl.duration(),