Fix align-content: center, flex-end alignment with margin #477
Reference in New Issue
Block a user
No description provided.
Delete Branch "position-margin"
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?
This fixes
align-content: center
andalign-content: flex-end
when the child exceeds the parents size. See #476. It also fixes those layouts if the child hasmargin: auto
set.After looking deeper into this, and trying to add failing tests, I found that it fails even without margin set, and also has an addional bug there with
margin: auto
. I'm now a lot more certain that this is a valid fix.@woehrl01 When you say "removing those lines", I believe you are referring to:
I don't have a specific example available. It looks like those lines were added in #185 which involved significant changes to the layout engine in order to make it better match the W3C flexbox spec.
#476 didn't repro in the version of the layout engine that is included in React Native 0.32.0-rc.0. So it seems those lines didn't break this scenario back then.
If you delete those lines, what prevents the calculated cross size from exceeding the available cross size when running in the at-most measure mode?
That's strange.
Nothing prevents it. But as the resulting value is only used for the
alignItem
/margin: auto
step, this value shouldn't be clipped, as the child is still bigger thenAT_MOST
wants it.I just want to share my findings, as I'm still not that convinced. But I also don't understand why that value should be clipped either.
@emilsjolander has imported this pull request. If you are a Facebook employee, you can view this diff on Phabricator.
@woehrl01 The test case I listed in #476 is still laid out incorrectly in master.
@rigdern that's strange, as I added a test case with exactly your values, which doesn't fail in the master. Could you please verify if I correctly adapted your failing layout?
@woehrl01 The test case I reported used a
position: absolute
element on the root with a non-zero value forleft
. Here's the diff: https://www.diffchecker.com/BD9BgS4m@rigdern Oh, thanks, I see! It's not the root node which isn't laid out correctly, I'll have a look. 🔨
Pull request closed