[React-Native]: Combining flexWrap, alignItems & wrap leads to unwanted alignment #1067
Reference in New Issue
Block a user
No description provided.
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Report
Issues and Steps to Reproduce
When margin is added to an item, inside a wrapping container, it should be ignored but it is taken into account during alignItems
Expected Behavior
In the following example the 2 colored square should be in the same spot
Actual Behavior
On the web (using react-native-web it works correctly)
On native, the second square is in the wrong spot cause it is centered inside height + margin instead of just height
i've added opacity to see what's happening
Link to Code
https://snack.expo.dev/@titozzz/yoga-issue-1067
Web:


Native:
Taking the chance to report something else that I noticed when using flexWrap, since it could have the same root cause as the original issue:
I have a horizontal container that uses flexWrap with two vertical child containers that will have two rectangles each. The rectangles have different heights. If I use space-between in the vertical child containers with flexWrap in the horizontal container, there will be a very weird overflow of the children.
flexWrap
(expected behavior, works correctly)flexWrap
(unexpected behavior)Is that expected? Looks like a bug too right?
Gentest snippets for both of these:
and
Needs to be checked for repro. When I ran under the current iteration of Yoga playground, it looked like the expected output.
Still reproduces on react native 0.79. (I've tried using experimental_LayoutConformance)