mirror of
https://github.com/status-im/react-native.git
synced 2025-01-27 01:40:08 +00:00
Fix flex within max width constraint
Reviewed By: gkassabli Differential Revision: D4147199 fbshipit-source-id: feb335eb8687a1b7939ee8cd8649e455e0c069a9
This commit is contained in:
parent
3ee5e97bcd
commit
72d11912f4
@ -964,6 +964,16 @@ static void computeChildFlexBasis(const CSSNodeRef node,
|
||||
childHeightMeasureMode = CSSMeasureModeExactly;
|
||||
}
|
||||
|
||||
if (!CSSValueIsUndefined(child->style.maxDimensions[CSSDimensionWidth])) {
|
||||
childWidth = child->style.maxDimensions[CSSDimensionWidth];
|
||||
childWidthMeasureMode = CSSMeasureModeAtMost;
|
||||
}
|
||||
|
||||
if (!CSSValueIsUndefined(child->style.maxDimensions[CSSDimensionHeight])) {
|
||||
childHeight = child->style.maxDimensions[CSSDimensionHeight];
|
||||
childHeightMeasureMode = CSSMeasureModeAtMost;
|
||||
}
|
||||
|
||||
// Measure the child
|
||||
layoutNodeInternal(child,
|
||||
childWidth,
|
||||
@ -1670,6 +1680,16 @@ static void layoutNodeImpl(const CSSNodeRef node,
|
||||
}
|
||||
}
|
||||
|
||||
if (!CSSValueIsUndefined(currentRelativeChild->style.maxDimensions[CSSDimensionWidth])) {
|
||||
childWidth = currentRelativeChild->style.maxDimensions[CSSDimensionWidth];
|
||||
childWidthMeasureMode = CSSMeasureModeAtMost;
|
||||
}
|
||||
|
||||
if (!CSSValueIsUndefined(currentRelativeChild->style.maxDimensions[CSSDimensionHeight])) {
|
||||
childHeight = currentRelativeChild->style.maxDimensions[CSSDimensionHeight];
|
||||
childHeightMeasureMode = CSSMeasureModeAtMost;
|
||||
}
|
||||
|
||||
const bool requiresStretchLayout =
|
||||
!isStyleDimDefined(currentRelativeChild, crossAxis) &&
|
||||
getAlignItem(node, currentRelativeChild) == CSSAlignStretch;
|
||||
@ -1859,6 +1879,16 @@ static void layoutNodeImpl(const CSSNodeRef node,
|
||||
getMarginAxis(child, CSSFlexDirectionColumn);
|
||||
}
|
||||
|
||||
if (!CSSValueIsUndefined(child->style.maxDimensions[CSSDimensionWidth])) {
|
||||
childWidth = child->style.maxDimensions[CSSDimensionWidth];
|
||||
childWidthMeasureMode = CSSMeasureModeAtMost;
|
||||
}
|
||||
|
||||
if (!CSSValueIsUndefined(child->style.maxDimensions[CSSDimensionHeight])) {
|
||||
childHeight = child->style.maxDimensions[CSSDimensionHeight];
|
||||
childHeightMeasureMode = CSSMeasureModeAtMost;
|
||||
}
|
||||
|
||||
// If the child defines a definite size for its cross axis, there's
|
||||
// no need to stretch.
|
||||
if (!isCrossSizeDefinite) {
|
||||
|
Loading…
x
Reference in New Issue
Block a user