Skip to content

Commit 9cdc19a

Browse files
zhongwuzwfacebook-github-bot
authored andcommitted
Fixes TextInput shaking when typing Chinese (#28805)
Summary: Fixes #28488. ## Changelog [iOS] [Fixed] - Fixes TextInput shaking when typing Chinese Pull Request resolved: #28805 Test Plan: Demo see #28488. Differential Revision: D21376803 Pulled By: shergin fbshipit-source-id: b1fe6cc5f67d42ef98a6c12b8ab9990feac0e2a7
1 parent 87d000f commit 9cdc19a

File tree

2 files changed

+8
-0
lines changed

2 files changed

+8
-0
lines changed

Libraries/Text/TextInput/Multiline/RCTUITextView.m

+4
Original file line numberDiff line numberDiff line change
@@ -104,6 +104,10 @@ - (void)setPlaceholderColor:(UIColor *)placeholderColor
104104

105105
- (void)setDefaultTextAttributes:(NSDictionary<NSAttributedStringKey, id> *)defaultTextAttributes
106106
{
107+
if ([_defaultTextAttributes isEqualToDictionary:defaultTextAttributes]) {
108+
return;
109+
}
110+
107111
_defaultTextAttributes = defaultTextAttributes;
108112
self.typingAttributes = defaultTextAttributes;
109113
[self _updatePlaceholder];

Libraries/Text/TextInput/Singleline/RCTUITextField.m

+4
Original file line numberDiff line numberDiff line change
@@ -68,6 +68,10 @@ - (void)setPlaceholderColor:(UIColor *)placeholderColor
6868

6969
- (void)setDefaultTextAttributes:(NSDictionary<NSAttributedStringKey, id> *)defaultTextAttributes
7070
{
71+
if ([_defaultTextAttributes isEqualToDictionary:defaultTextAttributes]) {
72+
return;
73+
}
74+
7175
_defaultTextAttributes = defaultTextAttributes;
7276
[super setDefaultTextAttributes:defaultTextAttributes];
7377
[self _updatePlaceholder];

0 commit comments

Comments
 (0)