File tree Expand file tree Collapse file tree 2 files changed +9
-3
lines changed
packages/svelte/src/motion Expand file tree Collapse file tree 2 files changed +9
-3
lines changed Original file line number Diff line number Diff line change
1
+ ---
2
+ ' svelte ' : patch
3
+ ---
4
+
5
+ fix: make Tween work with continuous target changes
Original file line number Diff line number Diff line change @@ -230,7 +230,6 @@ export class Tween {
230
230
set ( value , options ) {
231
231
set ( this . #target, value ) ;
232
232
233
- let previous_value = this . #current. v ;
234
233
let previous_task = this . #task;
235
234
236
235
let started = false ;
@@ -254,10 +253,12 @@ export class Tween {
254
253
if ( ! started ) {
255
254
started = true ;
256
255
257
- fn = interpolate ( /** @type {any } */ ( previous_value ) , value ) ;
256
+ const prev = this . #current. v ;
257
+
258
+ fn = interpolate ( prev , value ) ;
258
259
259
260
if ( typeof duration === 'function' ) {
260
- duration = duration ( /** @type { any } */ ( previous_value ) , value ) ;
261
+ duration = duration ( prev , value ) ;
261
262
}
262
263
263
264
previous_task ?. abort ( ) ;
You can’t perform that action at this time.
0 commit comments