Repository navigation
Take Text ellipsizeMode from the measured paragraph attributes on Android - #58865
Closed
bartlomiejbloniarz wants to merge 1 commit into
Closed
bartlomiejbloniarz wants to merge 1 commit into
bartlomiejbloniarz wants to merge 1 commit into
Conversation
…ndroid Summary: On Android, `ReactTextView` measured text with the paragraph attributes from its state, but drew the ellipsis from a separate `ellipsizeMode` view prop that starts as `tail`. The paragraph attributes default `ellipsizeMode` to `clip`. When a view is created with props that omit values equal to their defaults, an explicit `ellipsizeMode="clip"` never reached the view prop, so text with `numberOfLines` was truncated with an ellipsis instead of being clipped. `ReactTextView` now takes the ellipsis from the same paragraph attributes it is measured with, like `minimumFontSize` and `textBreakStrategy`, so a single source of truth decides it, as on iOS. Changelog: [Android][Fixed] - Fix `ellipsizeMode="clip"` being ignored on newly created `Text` Differential Revision: D123029564
|
@bartlomiejbloniarz has exported this pull request. If you are a Meta employee, you can view the originating Diff in D123029564. |
|
This pull request has been merged in 8cd9b76. |
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.
Summary:
On Android,
ReactTextViewmeasured text with the paragraph attributes from its state, but drew the ellipsis from a separateellipsizeModeview prop that starts astail. The paragraph attributes defaultellipsizeModetoclip. When a view is created with props that omit values equal to their defaults, an explicitellipsizeMode="clip"never reached the view prop, so text withnumberOfLineswas truncated with an ellipsis instead of being clipped.ReactTextViewnow takes the ellipsis from the same paragraph attributes it is measured with, likeminimumFontSizeandtextBreakStrategy, so a single source of truth decides it, as on iOS.Changelog: [Android][Fixed] - Fix
ellipsizeMode="clip"being ignored on newly createdTextDifferential Revision: D123029564