-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Text : Added EllipsizeMode for tail and clip alignment #14660
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
Conversation
…dle follow defaulty tail behaviour
vnext/Microsoft.ReactNative/Fabric/Composition/ParagraphComponentView.cpp
Outdated
Show resolved
Hide resolved
vnext/Microsoft.ReactNative/Fabric/Composition/ParagraphComponentView.cpp
Outdated
Show resolved
Hide resolved
// Reset m_textLayout when ellipsizeMode changes | ||
if (oldViewProps.paragraphAttributes.ellipsizeMode != newViewProps.paragraphAttributes.ellipsizeMode) { | ||
m_textLayout = nullptr; | ||
} | ||
if (oldViewProps.paragraphAttributes.adjustsFontSizeToFit != newViewProps.paragraphAttributes.adjustsFontSizeToFit) { | ||
m_requireRedraw = true; |
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.
Not related to this PR. But I think we need to reset the textlayout here, not just redraw.
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.
makes sense , let me create an issue for the same and add this fix.
Description
Added EllipsizeMode for tail and clip, for head and middle the behaviour maps to default tail alignment of ellipsis.
DirectWrite does not natively support head and middle truncation in the same way it supports tail.
A custom implementation will be required for the same adding that to backlog.
Type of Change
Why
This PR adds functionality to a prop EllipsizeMode particular to windows, this prop is tightly coupled with numberOfLines and adjusts the text alignment based on the ellipsis mode.
Resolves [Add Relevant Issue Here]
#13111
What
Made changes to paragraph.cpp to reflect ellipsis depending on the EllipsizeMode prop, and updating the text layout, text alignment for the same.
Screenshots
Testing
tested in playground.
Changelog
Should this change be included in the release notes: indicate yes or no
yes
Add a brief summary of the change to use in the release notes for the next release.
Added EllipsizeMode for tail and clip , for head and middle the behaviour maps to default tail alignment of ellipsis.
Microsoft Reviewers: Open in CodeFlow