We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
When a node has both a max height and a vertical margin, it appears that Yoga incorrectly considers the margins to take up part of the max height.
Here's some HTML representing a case that repros the bug:
<div style="width: 250px; height: 250px;"> <div style="width: 100px; height: 100px; max-height: 100px; margin-top: 20px;"></div> </div>
Here's the equivalent C code:
const YGNodeRef root = YGNodeNew(); YGNodeStyleSetFlexDirection(root, YGFlexDirectionRow); YGNodeStyleSetWidth(root, 250); YGNodeStyleSetHeight(root, 250); const YGNodeRef root_child0 = YGNodeNew(); YGNodeStyleSetWidth(root_child0, 100); YGNodeStyleSetHeight(root_child0, 100); YGNodeStyleSetMaxHeight(root_child0, 100); YGNodeStyleSetMargin(root_child0, YGEdgeTop, 20); YGNodeInsertChild(root, root_child0, 0); YGNodeCalculateLayout(root, YGUndefined, YGUndefined, YGDirectionLTR); YGNodePrint(root, YGPrintOptionsLayout | YGPrintOptionsChildren);
Child's height is 100:
{layout: {width: 250, height: 250, top: 0, left: 0}, children: [ {layout: {width: 100, height: 100, top: 20, left: 0}, }, ]},
This JSFiddle illustrates the expected behavior: https://jsfiddle.net/4mr6tbqq/
Child's height is 80:
{layout: {width: 250, height: 250, top: 0, left: 0}, children: [ {layout: {width: 100, height: 80, top: 20, left: 0}, }, ]},
The text was updated successfully, but these errors were encountered:
I got this, fix is coming in a few minutes. Thank you for the great description. 👍
Sorry, something went wrong.
@woehrl01 Thanks for the quick turnaround!
09f0c2d
No branches or pull requests
When a node has both a max height and a vertical margin, it appears that Yoga incorrectly considers the margins to take up part of the max height.
Repro Steps
Here's some HTML representing a case that repros the bug:
Here's the equivalent C code:
Expected Output
Child's height is 100:
This JSFiddle illustrates the expected behavior: https://jsfiddle.net/4mr6tbqq/
Actual Output
Child's height is 80:
The text was updated successfully, but these errors were encountered: