Skip to content

Commit 4a1239b

Browse files
author
farfromrefuge
committed
fix: prevent requestLayout in Akylas fork while updating cell in svelte
1 parent a98fa1d commit 4a1239b

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

src/collectionview/svelte/index.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -141,10 +141,15 @@ export default class CollectionViewViewElement extends NativeViewElementNode<Col
141141
// ensure we dont do unnecessary tasks if index did not change
142142
// console.log('updateListItem', args.index, _view.__CollectionViewCurrentIndex__);
143143
_view.__CollectionViewCurrentIndex__ = args.index;
144+
// _suspendNativeUpdates with special parameters for Akylas fork to preven requestLayout
145+
//@ts-ignore
146+
_view._suspendNativeUpdates(0, true, true);
144147
_view._batchUpdate(() => {
145148
componentInstance.$set(props);
146149
flush(); // we need to flush to make sure update is applied right away
147150
});
151+
//@ts-ignore
152+
_view._resumeNativeUpdates(0, true, true, true);
148153
}
149154
}
150155

0 commit comments

Comments
 (0)