Include a leaf's padding and border in its §4.5 automatic minimum size (#1978)#1978
Closed
adityasharat wants to merge 1 commit into
Closed
Include a leaf's padding and border in its §4.5 automatic minimum size (#1978)#1978adityasharat wants to merge 1 commit into
adityasharat wants to merge 1 commit into
Conversation
|
@adityasharat has exported this pull request. If you are a Meta employee, you can view the originating Diff in D108958715. |
react#1978) Summary: When a flex item with a measure function (such as text) participates in CSS Flexbox §4.5 automatic minimum sizing, its min-content contribution must include the item's own padding and border — the same box model the container-recursion branch and the normal measure pass already apply. The measure-function leaf branch previously returned only the measured content size, so a padded item was floored below its true minimum. Downstream this let content be clipped or wrapped even when there was room for it — for example a single unbroken word breaking across two lines because the floor was one padding-width too small. Both the canonical Yoga copy and the React Native vendored copy are updated, and `YGAutoMinSizeTest` gains coverage on the width (padding + border) and height (padding) axes. Changelog: [General][Fixed] - Include a node's padding and border in its automatic minimum size when it has a measure function Differential Revision: D108958715
9694c89 to
4cdd39d
Compare
adityasharat
added a commit
to adityasharat/react-native
that referenced
this pull request
Jun 18, 2026
react#57279) Summary: Pull Request resolved: react#57279 X-link: react/yoga#1978 When a flex item with a measure function (such as text) participates in CSS Flexbox §4.5 automatic minimum sizing, its min-content contribution must include the item's own padding and border — the same box model the container-recursion branch and the normal measure pass already apply. The measure-function leaf branch previously returned only the measured content size, so a padded item was floored below its true minimum. Downstream this let content be clipped or wrapped even when there was room for it — for example a single unbroken word breaking across two lines because the floor was one padding-width too small. Both the canonical Yoga copy and the React Native vendored copy are updated, and `YGAutoMinSizeTest` gains coverage on the width (padding + border) and height (padding) axes. Changelog: [General][Fixed] - Include a node's padding and border in its automatic minimum size when it has a measure function Reviewed By: astreet Differential Revision: D108958715
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:
When a flex item with a measure function (such as text) participates in CSS Flexbox §4.5 automatic minimum sizing, its min-content contribution must include the item's own padding and border — the same box model the container-recursion branch and the normal measure pass already apply. The measure-function leaf branch previously returned only the measured content size, so a padded item was floored below its true minimum. Downstream this let content be clipped or wrapped even when there was room for it — for example a single unbroken word breaking across two lines because the floor was one padding-width too small.
Both the canonical Yoga copy and the React Native vendored copy are updated, and
YGAutoMinSizeTestgains coverage on the width (padding + border) and height (padding) axes.Changelog:
[General][Fixed] - Include a node's padding and border in its automatic minimum size when it has a measure function
Differential Revision: D108958715