Fixed <TextInput> bug with autocapitalization
Reviewed By: shergin Differential Revision: D7304936 fbshipit-source-id: ef587db89b64e7111dfdeb049c3a1a334c15430b
This commit is contained in:
parent
41db09d573
commit
ff70ecf868
|
@ -102,7 +102,17 @@ RCT_NOT_IMPLEMENTED(- (instancetype)initWithFrame:(CGRect)frame)
|
|||
{
|
||||
NSInteger eventLag = _nativeEventCount - _mostRecentEventCount;
|
||||
|
||||
if (eventLag == 0 && ![attributedText isEqualToAttributedString:self.backedTextInputView.attributedText]) {
|
||||
// Remove tag attribute to ensure correct attributed string comparison.
|
||||
NSMutableAttributedString *const backedTextInputViewTextCopy = [self.backedTextInputView.attributedText mutableCopy];
|
||||
NSMutableAttributedString *const attributedTextCopy = [attributedText mutableCopy];
|
||||
|
||||
[backedTextInputViewTextCopy removeAttribute:RCTTextAttributesTagAttributeName
|
||||
range:NSMakeRange(0, backedTextInputViewTextCopy.length)];
|
||||
|
||||
[attributedTextCopy removeAttribute:RCTTextAttributesTagAttributeName
|
||||
range:NSMakeRange(0, attributedTextCopy.length)];
|
||||
|
||||
if (eventLag == 0 && ![attributedTextCopy isEqualToAttributedString:backedTextInputViewTextCopy]) {
|
||||
UITextRange *selection = self.backedTextInputView.selectedTextRange;
|
||||
NSInteger oldTextLength = self.backedTextInputView.attributedText.string.length;
|
||||
|
||||
|
|
Loading…
Reference in New Issue