mirror of
https://github.com/facebook/react-native.git
synced 2025-11-01 09:14:26 +00:00
Apply correct text attributes in TextInput.setTextAndSelection
Summary: Changelog: [internal] Make sure correct text attributes are used inside of view command. Reviewed By: sshic Differential Revision: D29585943 fbshipit-source-id: 4748c843ff586f1dd42f3a89460afb624f9b371a
This commit is contained in:
committed by
Facebook GitHub Bot
parent
d85d72d0d9
commit
b52950bda2
@@ -421,11 +421,9 @@ using namespace facebook::react;
|
||||
}
|
||||
_comingFromJS = YES;
|
||||
if (![value isEqualToString:_backedTextInputView.attributedText.string]) {
|
||||
NSMutableAttributedString *mutableString =
|
||||
[[NSMutableAttributedString alloc] initWithAttributedString:_backedTextInputView.attributedText];
|
||||
[mutableString replaceCharactersInRange:NSMakeRange(0, _backedTextInputView.attributedText.length)
|
||||
withString:value];
|
||||
[self _setAttributedString:mutableString];
|
||||
NSAttributedString *attributedString =
|
||||
[[NSAttributedString alloc] initWithString:value attributes:_backedTextInputView.defaultTextAttributes];
|
||||
[self _setAttributedString:attributedString];
|
||||
[self _updateState];
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user