@@ -128,6 +128,11 @@ static public TableViewSectionProxy processSection(Object obj)
128
128
*/
129
129
@ Kroll .method
130
130
public void appendRow (Object rows , @ Kroll .argument (optional = true ) KrollDict animation )
131
+ {
132
+ appendRowInternal (rows , animation , false );
133
+ }
134
+
135
+ private void appendRowInternal (Object rows , KrollDict animation , boolean internalUpdate )
131
136
{
132
137
final List <TableViewRowProxy > rowList = new ArrayList <>();
133
138
@@ -190,7 +195,11 @@ public void appendRow(Object rows, @Kroll.argument(optional = true) KrollDict an
190
195
191
196
// Allow updating rows after iteration.
192
197
shouldUpdate = true ;
193
- update ();
198
+
199
+ // don't update when coming from setData loop
200
+ if (!internalUpdate ) {
201
+ update ();
202
+ }
194
203
}
195
204
196
205
/**
@@ -508,7 +517,7 @@ public void setData(Object[] data)
508
517
final TableViewRowProxy row = (TableViewRowProxy ) d ;
509
518
510
519
// Handle TableViewRow.
511
- appendRow (row , null );
520
+ appendRowInternal (row , null , true );
512
521
513
522
} else if (d instanceof Object []) {
514
523
setData ((Object []) d );
@@ -519,7 +528,7 @@ public void setData(Object[] data)
519
528
520
529
// Handle TableViewRow dictionary.
521
530
row .handleCreationDict (new KrollDict ((HashMap ) d ));
522
- appendRow (row , null );
531
+ appendRowInternal (row , null , true );
523
532
524
533
} else if (d instanceof TableViewSectionProxy ) {
525
534
final TableViewSectionProxy section = (TableViewSectionProxy ) d ;
@@ -531,7 +540,6 @@ public void setData(Object[] data)
531
540
532
541
// Allow updating rows after iteration.
533
542
shouldUpdate = true ;
534
-
535
543
update ();
536
544
}
537
545
0 commit comments