Fix Yoga flexshrink with min-width sizing issue
Summary: While resolving the flexible items we calculate totalFlexShrinkScaledFactors which uses the flexBasis or initial width of node (Not min-width). At a later stage during distribution of space we are subtracting value from this which also takes care of min-width. For example If node has flexShrink 1 and width 100 and min-width 301 then totalFlexShrinkScaledFactors will become -1*100 = -100 but later we are subtracting -1 * 301 (min-width) = -301 which is ambiguous and causing layout inconsistencies with how web behaves. Fixed this by only using the flexBasis or width for these calculations. Changelog: [Internal][Yoga] Fix layout issue when flexShrink and min-width are used together Reviewed By: pasqualeanatriello Differential Revision: D20219419 fbshipit-source-id: 948fbc06ca541d4ad307c88c8a2df65d157778b1
This commit is contained in:
committed by
Facebook GitHub Bot
parent
0f08aa53da
commit
ecd7790dd8
@@ -2338,7 +2338,8 @@ static void YGDistributeFreeSpaceFirstPass(
|
|||||||
// first and second passes.
|
// first and second passes.
|
||||||
deltaFreeSpace += boundMainSize - childFlexBasis;
|
deltaFreeSpace += boundMainSize - childFlexBasis;
|
||||||
collectedFlexItemsValues.totalFlexShrinkScaledFactors -=
|
collectedFlexItemsValues.totalFlexShrinkScaledFactors -=
|
||||||
flexShrinkScaledFactor;
|
(-currentRelativeChild->resolveFlexShrink() *
|
||||||
|
currentRelativeChild->getLayout().computedFlexBasis.unwrap());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} else if (
|
} else if (
|
||||||
|
Reference in New Issue
Block a user