Skip to content

Commit

Permalink
Fixes TextInput shaking when typing Chinese (#28805)
Browse files Browse the repository at this point in the history
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
  • Loading branch information
zhongwuzw authored and facebook-github-bot committed May 4, 2020
1 parent 87d000f commit 9cdc19a
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 0 deletions.
4 changes: 4 additions & 0 deletions Libraries/Text/TextInput/Multiline/RCTUITextView.m
Original file line number Diff line number Diff line change
Expand Up @@ -104,6 +104,10 @@ - (void)setPlaceholderColor:(UIColor *)placeholderColor

- (void)setDefaultTextAttributes:(NSDictionary<NSAttributedStringKey, id> *)defaultTextAttributes
{
if ([_defaultTextAttributes isEqualToDictionary:defaultTextAttributes]) {
return;
}

_defaultTextAttributes = defaultTextAttributes;
self.typingAttributes = defaultTextAttributes;
[self _updatePlaceholder];
Expand Down
4 changes: 4 additions & 0 deletions Libraries/Text/TextInput/Singleline/RCTUITextField.m
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,10 @@ - (void)setPlaceholderColor:(UIColor *)placeholderColor

- (void)setDefaultTextAttributes:(NSDictionary<NSAttributedStringKey, id> *)defaultTextAttributes
{
if ([_defaultTextAttributes isEqualToDictionary:defaultTextAttributes]) {
return;
}

_defaultTextAttributes = defaultTextAttributes;
[super setDefaultTextAttributes:defaultTextAttributes];
[self _updatePlaceholder];
Expand Down

0 comments on commit 9cdc19a

Please sign in to comment.