Skip to content
Permalink
Browse files

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
  • Loading branch information...
shergin authored and facebook-github-bot committed Jan 25, 2018
1 parent e9b83e6 commit 46fd8643485b21147c780d22ee8cf751b2dc8750
Showing with 1 addition and 1 deletion.
  1. +1 −1 Libraries/Text/TextInput/RCTBaseTextInputView.m
@@ -102,7 +102,7 @@ - (void)setAttributedText:(NSAttributedString *)attributedText
{
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;

0 comments on commit 46fd864

Please sign in to comment.
You can’t perform that action at this time.