Skip to content

Commit

Permalink
Instantly start animation progress.
Browse files Browse the repository at this point in the history
  • Loading branch information
davidjerleke committed Nov 22, 2024
1 parent e32119a commit ba2c14c
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion packages/embla-carousel/src/components/Animations.ts
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,11 @@ export function Animations(

function animate(timeStamp: DOMHighResTimeStamp): void {
if (!animationId) return
if (!lastTimeStamp) lastTimeStamp = timeStamp
if (!lastTimeStamp) {
lastTimeStamp = timeStamp
update()
update()
}

const timeElapsed = timeStamp - lastTimeStamp
lastTimeStamp = timeStamp
Expand Down

0 comments on commit ba2c14c

Please sign in to comment.