@@ -491,17 +491,6 @@ export class CollectionView extends CollectionViewBase {
491491 }
492492 view . reloadItemsAtIndexPaths ( indexes ) ;
493493 } else {
494- if ( event . addedCount > 0 ) {
495- const indexes = NSMutableArray . alloc < NSIndexPath > ( ) . init ( ) ;
496- for ( let index = 0 ; index < event . addedCount ; index ++ ) {
497- indexes . addObject ( NSIndexPath . indexPathForItemInSection ( event . index + index , 0 ) ) ;
498- if ( sizes ) {
499- sizes . insertObjectAtIndex ( NSValue . valueWithCGSize ( CGSizeZero ) , event . index ) ;
500- }
501- // this._sizes.splice(event.index, 0, null);
502- }
503- view . insertItemsAtIndexPaths ( indexes ) ;
504- }
505494 if ( event . removed && event . removed . length > 0 ) {
506495 const indexes = NSMutableArray . new < NSIndexPath > ( ) ;
507496 for ( let index = 0 ; index < event . removed . length ; index ++ ) {
@@ -517,6 +506,20 @@ export class CollectionView extends CollectionViewBase {
517506 }
518507 view . deleteItemsAtIndexPaths ( indexes ) ;
519508 }
509+ if ( event . addedCount > 0 ) {
510+ const indexes = NSMutableArray . alloc < NSIndexPath > ( ) . init ( ) ;
511+ for ( let index = 0 ; index < event . addedCount ; index ++ ) {
512+ indexes . addObject ( NSIndexPath . indexPathForItemInSection ( event . index + index , 0 ) ) ;
513+ if ( sizes ) {
514+ sizes . insertObjectAtIndex ( NSValue . valueWithCGSize ( CGSizeZero ) , event . index ) ;
515+ }
516+ // this._sizes.splice(event.index, 0, null);
517+ }
518+ if ( Trace . isEnabled ( ) ) {
519+ CLog ( CLogTypes . info , 'insertItemsAtIndexPaths' , indexes . count ) ;
520+ }
521+ view . insertItemsAtIndexPaths ( indexes ) ;
522+ }
520523 }
521524 // view.collectionViewLayout.invalidateLayout();
522525 } , null ) ;
0 commit comments