-
Notifications
You must be signed in to change notification settings - Fork 65
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix style update with emojis on iOS #318
Fix style update with emojis on iOS #318
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM however GH actions shows some warnings about undeclared selectors
#else | ||
[_textInput setAttributedText:_textInput.attributedText]; // apply new styles | ||
#endif | ||
[_textInput setAttributedText:_textView.attributedText]; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Will _textView
always be defined? It looks like if the underlying view is RCTUITextField
it will be initialized, no?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You're right (as always), changed in 8720e3e, now it works both for singleline and multiline.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, please make CI happy 😄
I forgot about Fabric 😢 |
Details
This PR fixes formatting of the Markdown string after
style
andmarkdownStyle
ofMarkdownTextInput
are updated, in case when the value contains an emoji.Screen.Recording.2024-04-17.at.11.53.24.mov
This was previously fixed in #269 but it turns out that it only works correctly if the string does not contain any emojis.
The root cause of this issue is that
setAttributedText
skips the update if the attributed string are, however, if the string contains an emoji, the fallback mode is used and only the raw strings are compared:https://github.com/facebook/react-native/blob/58ddd74202bede2238768def01898741606ec64f/packages/react-native/Libraries/Text/TextInput/RCTBaseTextInputView.mm#L128-L165
Related Issues
Fixes #293.
Manual Tests
Repro: #293 (comment)
Linked PRs