Commit 791afee
Fix auto-sized parent not accounting for child min-width in canSkipFlex path
Summary:
When a flex container with auto main-axis is measured with a with a known cross dimensions, the `canSkipFlex` optimization in `justifyMainAxis` uses `computedFlexBasis` directly. This doesn't account for the `min` & `max` width constraints, causing the parent to undersize.
I have added a `.html` test page here to mirror the C++ test I added to confirm that flexbox does respect the min-width constraint. [minwidth-test.html](https://github.com/user-attachments/files/25695677/minwidth-test.html)
Changelog: [internal]
X-link: facebook/yoga#1905
Reviewed By: sammy-SC, adityasharat
Differential Revision: D95177338
Pulled By: NickGerleman1 parent 320e3bd commit 791afee
File tree
1 file changed
+8
-1
lines changed- packages/react-native/ReactCommon/yoga/yoga/algorithm
1 file changed
+8
-1
lines changedLines changed: 8 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1149 | 1149 | | |
1150 | 1150 | | |
1151 | 1151 | | |
1152 | | - | |
| 1152 | + | |
| 1153 | + | |
| 1154 | + | |
| 1155 | + | |
| 1156 | + | |
| 1157 | + | |
| 1158 | + | |
| 1159 | + | |
1153 | 1160 | | |
1154 | 1161 | | |
1155 | 1162 | | |
| |||
0 commit comments