File tree Expand file tree Collapse file tree 1 file changed +11
-1
lines changed
Expand file tree Collapse file tree 1 file changed +11
-1
lines changed Original file line number Diff line number Diff line change @@ -102,7 +102,17 @@ - (void)setAttributedText:(NSAttributedString *)attributedText
102102{
103103 NSInteger eventLag = _nativeEventCount - _mostRecentEventCount;
104104
105- if (eventLag == 0 && ![attributedText isEqualToAttributedString: self .backedTextInputView.attributedText]) {
105+ // Remove tag attribute to ensure correct attributed string comparison.
106+ NSMutableAttributedString *const backedTextInputViewTextCopy = [self .backedTextInputView.attributedText mutableCopy ];
107+ NSMutableAttributedString *const attributedTextCopy = [attributedText mutableCopy ];
108+
109+ [backedTextInputViewTextCopy removeAttribute: RCTTextAttributesTagAttributeName
110+ range: NSMakeRange (0 , backedTextInputViewTextCopy.length)];
111+
112+ [attributedTextCopy removeAttribute: RCTTextAttributesTagAttributeName
113+ range: NSMakeRange (0 , attributedTextCopy.length)];
114+
115+ if (eventLag == 0 && ![attributedTextCopy isEqualToAttributedString: backedTextInputViewTextCopy]) {
106116 UITextRange *selection = self.backedTextInputView .selectedTextRange ;
107117 NSInteger oldTextLength = self.backedTextInputView .attributedText .string .length ;
108118
You can’t perform that action at this time.
0 commit comments