Skip to content
This repository was archived by the owner on Jun 3, 2021. It is now read-only.

Commit 5ca1f00

Browse files
caixiaomincxfeng1
authored andcommitted
[WEEX-500][iOS] Fix Sticky in List will not be removed in some cases
1 parent bedc6aa commit 5ca1f00

File tree

2 files changed

+6
-1
lines changed

2 files changed

+6
-1
lines changed

ios/sdk/WeexSDK/Sources/Component/WXScrollerComponent.mm

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -354,7 +354,9 @@ - (void)removeStickyComponent:(WXComponent *)sticky
354354
{
355355
if([self.stickyArray containsObject:sticky]) {
356356
[self.stickyArray removeObject:sticky];
357-
[self adjustSticky];
357+
WXPerformBlockOnMainThread(^{
358+
[self adjustSticky];
359+
});
358360
}
359361
}
360362

ios/sdk/WeexSDK/Sources/Model/WXComponent.mm

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -602,6 +602,9 @@ - (void)_removeFromSupercomponent
602602
[self.weexInstance.componentManager removeFixedComponent:self];
603603
self->_isNeedJoinLayoutSystem = YES;
604604
}
605+
if (_positionType == WXPositionTypeSticky) {
606+
[self.ancestorScroller removeStickyComponent:self];
607+
}
605608
}
606609

607610
- (void)_moveToSupercomponent:(WXComponent *)newSupercomponent atIndex:(NSUInteger)index

0 commit comments

Comments
 (0)