Skip to content

Formalize Text in JS as overflow: hidden by default (fixes overflow: visible text with props 2.0)#55553

Open
NickGerleman wants to merge 1 commit intofacebook:mainfrom
NickGerleman:export-D93324626
Open

Formalize Text in JS as overflow: hidden by default (fixes overflow: visible text with props 2.0)#55553
NickGerleman wants to merge 1 commit intofacebook:mainfrom
NickGerleman:export-D93324626

Conversation

@NickGerleman
Copy link
Contributor

Summary:
RN components on the native side currently act like a mix of both overflow: hidden and overflow: visible, veering closer to the former in the ways that matter most.

PreparedLayoutTextView lets us do implement this more correctly, and either clip text to padding box, or not clip the text at all.

For compat, PreparedLayoutTextView kept its overflow as hidden by default. Props 2.0, broke this, since we need to see overflow state change in Fabric props, which defaults to Yoga blank style defaults.

The sanest solution I could find, was to change the View and ViewManager to match the Fabric defaults, as its default state, and set overflow: hidden as an explicit default in Text.

Changelog:
[General][Changed] - Text is no longer drawn on top of borders by default
[General][Changed] - Text outside the bounds of a borderRadius is now hidden by default

Differential Revision: D93324626

@meta-cla meta-cla bot added the CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. label Feb 14, 2026
@meta-codesync
Copy link

meta-codesync bot commented Feb 14, 2026

@NickGerleman has exported this pull request. If you are a Meta employee, you can view the originating Diff in D93324626.

…visible text with props 2.0) (facebook#55553)

Summary:
Pull Request resolved: facebook#55553

RN components on the native side currently act like a mix of both overflow: hidden and overflow: visible, veering closer to the former in the ways that matter most.

PreparedLayoutTextView lets us do implement this more correctly, and either clip text to padding box, or not clip the text at all.

For compat, PreparedLayoutTextView kept its overflow as hidden by default. Props 2.0, broke this, since we need to see overflow state change in Fabric props, which defaults to Yoga blank style defaults.

The sanest solution I could find, was to change the View and ViewManager to match the Fabric defaults, as its default state, and set `overflow: hidden` as an explicit default in `Text`.

Changelog:
[General][Changed] - Text is no longer drawn on top of borders by default
[General][Changed] - Text outside the bounds of a borderRadius is now hidden by default

Differential Revision: D93324626
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. fb-exported meta-exported p: Facebook Partner: Facebook Partner

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants