Skip to content

Commit 10ee7b3

Browse files
committed
fix: ensure that CSS is generated for the final frame of a transition
1 parent a764f4e commit 10ee7b3

File tree

2 files changed

+6
-1
lines changed

2 files changed

+6
-1
lines changed

.changeset/funny-ties-jump.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
'svelte': patch
3+
---
4+
5+
fix: ensure that CSS is generated for the final frame of a transition

packages/svelte/src/internal/client/dom/elements/transitions.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -322,7 +322,7 @@ function animate(element, options, counterpart, t2, callback) {
322322
if (css) {
323323
// WAAPI
324324
var keyframes = [];
325-
var n = duration / (1000 / 60);
325+
var n = Math.ceil(duration / (1000 / 60)); // `n` must be an integer, or we risk missing the `t2` value
326326

327327
for (var i = 0; i <= n; i += 1) {
328328
var t = t1 + delta * easing(i / n);

0 commit comments

Comments
 (0)