Skip to content

Skip display: none children when finding a flex container's baseline (#2107) - #60407

Merged
meta-codesync[bot] merged 1 commit into
react:mainfrom
javache:export-D135033729
Nov 30, 2026
Merged

meta-codesync[bot] merged 1 commit into
react:mainfrom
javache:export-D135033729

Conversation

@javache

@javache javache commented Nov 30, 2026

Copy link
Copy Markdown
Contributor

Summary:
A display: none child is not a flex item, so it cannot supply its
container's baseline (css-flexbox-1 §8.5) or make its row a baseline
layout. calculateBaseline chose a hidden first child, whose zeroed-out
layout has a NaN measured height, and isBaselineLayout counted a hidden
align-self: baseline child.

calculateBaseline also read the line index of children that are not flex
items before skipping them. Only flex items are assigned to lines, so a
stale index from an earlier layout could end the search early.

Reviewed By: javache

Differential Revision: D135033729

react#2107)

Summary:
A `display: none` child is not a flex item, so it cannot supply its
container's baseline (css-flexbox-1 §8.5) or make its row a baseline
layout. `calculateBaseline` chose a hidden first child, whose zeroed-out
layout has a NaN measured height, and `isBaselineLayout` counted a hidden
`align-self: baseline` child.

`calculateBaseline` also read the line index of children that are not flex
items before skipping them. Only flex items are assigned to lines, so a
stale index from an earlier layout could end the search early.

Reviewed By: javache

Differential Revision: D135033729
@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 Nov 30, 2026
@meta-codesync

meta-codesync Bot commented Nov 30, 2026

Copy link
Copy Markdown

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

@meta-codesync
meta-codesync Bot merged commit c65964d into react:main Nov 30, 2026
58 of 66 checks passed
@react-native-bot

Copy link
Copy Markdown
Collaborator

This pull request was successfully merged by @javache in c65964d

When will my fix make it into a release? | How to file a pick request?

@react-native-bot react-native-bot added the Merged This PR has been merged. label Nov 30, 2026
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. Merged This PR has been merged. meta-exported p: Facebook Partner: Facebook Partner

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants