From 8b027b25a5c0cce4dd6a6f5ce8b0622158b6fa53 Mon Sep 17 00:00:00 2001 From: Daisuke Iwasaki Date: Mon, 23 Apr 2018 00:09:38 +0900 Subject: [PATCH] Update RCTBaseTextInputShadowView.m [iOS][TextInput] Fix controlled TextInput for Chinese (and other languages) #18456 --- .../Text/TextInput/RCTBaseTextInputShadowView.m | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/Libraries/Text/TextInput/RCTBaseTextInputShadowView.m b/Libraries/Text/TextInput/RCTBaseTextInputShadowView.m index e145d4a3b0c870..41b24e219d25cd 100644 --- a/Libraries/Text/TextInput/RCTBaseTextInputShadowView.m +++ b/Libraries/Text/TextInput/RCTBaseTextInputShadowView.m @@ -25,6 +25,7 @@ @implementation RCTBaseTextInputShadowView NSAttributedString *_Nullable _localAttributedText; CGSize _previousContentSize; + NSString *_text; NSTextStorage *_textStorage; NSTextContainer *_textContainer; NSLayoutManager *_layoutManager; @@ -97,6 +98,17 @@ - (void)invalidateContentSize }); } +- (NSString *)text +{ + return _text; +} + +- (void)setText:(NSString *)text +{ + _text = text; + _previousAttributedText = _localAttributedText; +} + #pragma mark - RCTUIManagerObserver - (void)uiManagerWillPerformMounting