Skip to content

Commit 630f022

Browse files
committed
fix(ios): autoReloadItemOnLayout handle more cases
1 parent d082f0d commit 630f022

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

src/collectionview/index.ios.ts

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -796,9 +796,10 @@ export class CollectionView extends CollectionViewBase {
796796
}
797797

798798
nativeView.performBatchUpdatesCompletion(() => {
799-
// this.measureCell(cell, view, index);
800799
this.notifyForItemAtIndex(CollectionViewBase.itemLoadingEvent, view, indexPath.row, view.bindingContext, cell);
801-
// cell.contentView.subviews.objectAtIndex(0)?.layoutSubviews();
800+
// the order is important because measureCell will set layout as requested and notifyForItemAtIndex would call requestLayout => endless loop
801+
this.measureCell(cell, view, index);
802+
cell.contentView.subviews.objectAtIndex(0)?.layoutSubviews();
802803
// nativeView.collectionViewLayout.invalidateLayout();
803804
}, null);
804805
}

0 commit comments

Comments
 (0)