Merged
Conversation
Skalakid
reviewed
Apr 17, 2024
Contributor
Skalakid
left a comment
There was a problem hiding this comment.
LGTM however GH actions shows some warnings about undeclared selectors
j-piasecki
reviewed
Apr 18, 2024
| #else | ||
| [_textInput setAttributedText:_textInput.attributedText]; // apply new styles | ||
| #endif | ||
| [_textInput setAttributedText:_textView.attributedText]; |
Collaborator
There was a problem hiding this comment.
Will _textView always be defined? It looks like if the underlying view is RCTUITextField it will be initialized, no?
Collaborator
Author
There was a problem hiding this comment.
You're right (as always), changed in 8720e3e, now it works both for singleline and multiline.
6 tasks
j-piasecki
previously approved these changes
May 21, 2024
Collaborator
j-piasecki
left a comment
There was a problem hiding this comment.
LGTM, please make CI happy 😄
Collaborator
Author
|
I forgot about Fabric 😢 |
j-piasecki
approved these changes
May 21, 2024
6 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Details
This PR fixes formatting of the Markdown string after
styleandmarkdownStyleofMarkdownTextInputare 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
setAttributedTextskips 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