diff --git a/packages/react-native/ReactCommon/react/renderer/textlayoutmanager/platform/ios/react/renderer/textlayoutmanager/RCTTextLayoutManager.mm b/packages/react-native/ReactCommon/react/renderer/textlayoutmanager/platform/ios/react/renderer/textlayoutmanager/RCTTextLayoutManager.mm index 5f9847a398fa..d8cdc11dd8ac 100644 --- a/packages/react-native/ReactCommon/react/renderer/textlayoutmanager/platform/ios/react/renderer/textlayoutmanager/RCTTextLayoutManager.mm +++ b/packages/react-native/ReactCommon/react/renderer/textlayoutmanager/platform/ios/react/renderer/textlayoutmanager/RCTTextLayoutManager.mm @@ -347,10 +347,25 @@ - (void)processTruncatedAttributedText:(NSTextStorage *)textStorage // Remove color attributes for truncated range for (NSAttributedStringKey key in @[ NSForegroundColorAttributeName, NSBackgroundColorAttributeName ]) { - [textStorage removeAttribute:key range:characterRange]; id attribute = [textStorage attribute:key atIndex:characterRange.location - 1 effectiveRange:nil]; + __block BOOL rangeAlreadyMatches = YES; + [textStorage enumerateAttribute:key + inRange:characterRange + options:0 + usingBlock:^(id value, NSRange range, BOOL *stopEnumerating) { + BOOL isEqual = value == attribute || + (value != nil && attribute != nil && [value isEqual:attribute]); + if (!isEqual) { + rangeAlreadyMatches = NO; + *stopEnumerating = YES; + } + }]; + if (rangeAlreadyMatches) { + continue; + } + [textStorage removeAttribute:key range:characterRange]; if (attribute != nullptr) { [textStorage addAttribute:key value:attribute range:characterRange]; }