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
Open
Formalize Text in JS as overflow: hidden by default (fixes overflow: visible text with props 2.0)#55553NickGerleman wants to merge 1 commit intofacebook:mainfrom
NickGerleman wants to merge 1 commit intofacebook:mainfrom
Conversation
|
@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
ee8d283 to
6d4fea0
Compare
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:
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: hiddenas an explicit default inText.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