Skip to content

Commit 19cc38b

Browse files
committed
Merge branch 'master' of github.com:nativescript-community/nativescript-collectionview
2 parents 4b15df2 + 20fd5da commit 19cc38b

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

src/collectionview/index.ios.ts

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -546,7 +546,17 @@ export class CollectionView extends CollectionViewBase {
546546
if (!view) {
547547
return;
548548
}
549+
const sizes: NSMutableArray<NSValue> = this._delegate instanceof UICollectionViewDelegateImpl ? this._delegate.cachedSizes : null;
550+
549551
const visibles = view.indexPathsForVisibleItems;
552+
553+
if (sizes) {
554+
const indexes: NSIndexPath[] = Array.from(visibles);
555+
indexes.forEach((value) => {
556+
sizes.replaceObjectAtIndexWithObject(value.row, NSValue.valueWithCGSize(CGSizeZero));
557+
});
558+
}
559+
550560
UIView.performWithoutAnimation(() => {
551561
view.performBatchUpdatesCompletion(() => {
552562
view.reloadItemsAtIndexPaths(visibles);

0 commit comments

Comments
 (0)