From 46fd8643485b21147c780d22ee8cf751b2dc8750 Mon Sep 17 00:00:00 2001 From: Valentin Shergin Date: Thu, 25 Jan 2018 13:40:28 -0800 Subject: [PATCH] Proper attributed strings comparsion in RCTBaseTextInputView Summary: Now, in the new model, we transfer text attributes with actual text via attributed text to a native text component, so previous text-only comparsion is not sufficient anymore. Depends on D6600685. Differential Revision: D6809833 fbshipit-source-id: 475b7426cf3c6694781790d99ef32466606da2f2 --- Libraries/Text/TextInput/RCTBaseTextInputView.m | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Libraries/Text/TextInput/RCTBaseTextInputView.m b/Libraries/Text/TextInput/RCTBaseTextInputView.m index 91f6a980f..13b815058 100644 --- a/Libraries/Text/TextInput/RCTBaseTextInputView.m +++ b/Libraries/Text/TextInput/RCTBaseTextInputView.m @@ -102,7 +102,7 @@ RCT_NOT_IMPLEMENTED(- (instancetype)initWithFrame:(CGRect)frame) { NSInteger eventLag = _nativeEventCount - _mostRecentEventCount; - if (eventLag == 0 && ![attributedText.string isEqualToString:self.backedTextInputView.attributedText.string]) { + if (eventLag == 0 && ![attributedText isEqualToAttributedString:self.backedTextInputView.attributedText]) { UITextRange *selection = self.backedTextInputView.selectedTextRange; NSInteger oldTextLength = self.backedTextInputView.attributedText.string.length;