From 65fbf369adcc74daa00a776fb107125e132b7dc9 Mon Sep 17 00:00:00 2001 From: mengyanluo Date: Mon, 2 Aug 2021 15:32:26 +0800 Subject: [PATCH] fix(ios): fix hippytext reuse bug --- ios/sdk/component/text/HippyText.mm | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/ios/sdk/component/text/HippyText.mm b/ios/sdk/component/text/HippyText.mm index 23e2b68b2..1862506c7 100644 --- a/ios/sdk/component/text/HippyText.mm +++ b/ios/sdk/component/text/HippyText.mm @@ -64,6 +64,18 @@ static void collectNonTextDescendants(HippyText *view, NSMutableArray *nonTextDe }]; } +- (void)removeHippySubview:(UIView *)subview { + if ([[self hippySubviews] containsObject:subview]) { + [super removeHippySubview:subview]; + } + else { + NSArray *hippySubviews = [self hippySubviews]; + for (UIView *hippySubview in hippySubviews) { + [hippySubview removeHippySubview:subview]; + } + } +} + - (void)hippySetInheritedBackgroundColor:(__unused UIColor *)inheritedBackgroundColor { // mttrn: // UIColor *backgroundColor = [self rightBackgroundColorOfTheme];