Skip to content

Commit 0155f37

Browse files
committed
Read previous_value at a later stage in Tween.set
1 parent f7f87dc commit 0155f37

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

packages/svelte/src/motion/tweened.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -230,7 +230,7 @@ export class Tween {
230230
set(value, options) {
231231
set(this.#target, value);
232232

233-
let previous_value = this.#current.v;
233+
let previous_value = this.#current;
234234
let previous_task = this.#task;
235235

236236
let started = false;
@@ -254,10 +254,10 @@ export class Tween {
254254
if (!started) {
255255
started = true;
256256

257-
fn = interpolate(/** @type {any} */ (previous_value), value);
257+
fn = interpolate(/** @type {any} */ (previous_value.v), value);
258258

259259
if (typeof duration === 'function') {
260-
duration = duration(/** @type {any} */ (previous_value), value);
260+
duration = duration(/** @type {any} */ (previous_value.v), value);
261261
}
262262

263263
previous_task?.abort();

0 commit comments

Comments
 (0)