File tree Expand file tree Collapse file tree 1 file changed +12
-15
lines changed
packages/svelte/src/internal/client Expand file tree Collapse file tree 1 file changed +12
-15
lines changed Original file line number Diff line number Diff line change @@ -25,7 +25,6 @@ import {
25
25
mutable_source ,
26
26
push_destroy_fn ,
27
27
render_effect ,
28
- schedule_task ,
29
28
set_signal_value ,
30
29
source
31
30
} from './runtime.js' ;
@@ -486,6 +485,17 @@ function reconcile_tracked_array(
486
485
key = is_computed_key ? keys [ a ] : item ;
487
486
map_set ( item_index , key , a ) ;
488
487
}
488
+ // If keys are animated, we need to do updates before actual moves
489
+ if ( is_animated ) {
490
+ for ( b = start ; b <= a_end ; ++ b ) {
491
+ a = map_get ( item_index , /** @type {V } */ ( a_blocks [ b ] . k ) ) ;
492
+ if ( a !== undefined ) {
493
+ item = array [ a ] ;
494
+ block = a_blocks [ b ] ;
495
+ update_each_item_block ( block , item , a , flags ) ;
496
+ }
497
+ }
498
+ }
489
499
for ( b = start ; b <= a_end ; ++ b ) {
490
500
a = map_get ( item_index , /** @type {V } */ ( a_blocks [ b ] . k ) ) ;
491
501
block = a_blocks [ b ] ;
@@ -501,22 +511,9 @@ function reconcile_tracked_array(
501
511
if ( pos === MOVED_BLOCK ) {
502
512
mark_lis ( sources ) ;
503
513
}
504
- // If keys are animated, we need to do updates before actual moves
505
- var should_create ;
506
- if ( is_animated ) {
507
- var i = b_length ;
508
- while ( i -- > 0 ) {
509
- b_end = i + start ;
510
- a = sources [ i ] ;
511
- if ( pos === MOVED_BLOCK ) {
512
- block = b_blocks [ b_end ] ;
513
- item = array [ b_end ] ;
514
- update_each_item_block ( block , item , b_end , flags ) ;
515
- }
516
- }
517
- }
518
514
var last_block ;
519
515
var last_sibling ;
516
+ var should_create ;
520
517
while ( b_length -- > 0 ) {
521
518
b_end = b_length + start ;
522
519
a = sources [ b_length ] ;
You can’t perform that action at this time.
0 commit comments