@@ -3,7 +3,7 @@ import { profile } from '@nativescript/core/profiling';
33import { ContentView , LayoutBase , StackLayout , ViewBase } from '@nativescript/core/ui' ;
44import { NativeViewElementNode , TemplateElement , ViewNode , createElement , registerElement } from 'svelte-native/dom' ;
55import { flush } from 'svelte/internal' ;
6- import { CollectionView } from '..'
6+ import { CollectionView } from '..' ;
77
88declare module '@nativescript/core/ui/core/view-base' {
99 interface ViewBase {
@@ -72,7 +72,7 @@ export default class CollectionViewViewElement extends NativeViewElementNode<Col
7272 const builder = ( parentView , props : any ) => {
7373 ( nativeEl as any ) . __SvelteComponent__ = new componentClass ( {
7474 target : parentView ,
75- props,
75+ props
7676 } ) ;
7777 } ;
7878 // in svelte we want to add the wrapper as a child of the collectionview ourselves
@@ -133,8 +133,10 @@ export default class CollectionViewViewElement extends NativeViewElementNode<Col
133133 // ensure we dont do unnecessary tasks if index did not change
134134 // console.log('updateListItem', args.index, _view.__CollectionViewCurrentIndex__);
135135 _view . __CollectionViewCurrentIndex__ = args . index ;
136- componentInstance . $set ( props ) ;
137- flush ( ) ; // we need to flush to make sure update is applied right away
136+ _view . _batchUpdate ( ( ) => {
137+ componentInstance . $set ( props ) ;
138+ flush ( ) ; // we need to flush to make sure update is applied right away
139+ } ) ;
138140 }
139141 }
140142
0 commit comments