Skip to content

Include a leaf's padding and border in its §4.5 automatic minimum size (#1978)#1978

Closed
adityasharat wants to merge 1 commit into
react:mainfrom
adityasharat:export-D108958715
Closed

Include a leaf's padding and border in its §4.5 automatic minimum size (#1978)#1978
adityasharat wants to merge 1 commit into
react:mainfrom
adityasharat:export-D108958715

Conversation

@adityasharat

@adityasharat adityasharat commented Jun 18, 2026

Copy link
Copy Markdown
Contributor

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

@meta-cla meta-cla Bot added the CLA Signed label Jun 18, 2026
@meta-codesync

meta-codesync Bot commented Jun 18, 2026

Copy link
Copy Markdown

@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
@meta-codesync meta-codesync Bot changed the title Include a leaf's padding and border in its §4.5 automatic minimum size Include a leaf's padding and border in its §4.5 automatic minimum size (#1978) Jun 18, 2026
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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant