mirror of
https://github.com/status-im/react-native.git
synced 2025-01-14 11:34:23 +00:00
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;
|
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;
|
UITextRange *selection = self.backedTextInputView.selectedTextRange;
|
||||||
NSInteger oldTextLength = self.backedTextInputView.attributedText.string.length;
|
NSInteger oldTextLength = self.backedTextInputView.attributedText.string.length;
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user