From ab64a5b62463b274050afabeb0094fbef3a3b02b Mon Sep 17 00:00:00 2001 From: Christopher Chedeau Date: Thu, 11 Dec 2014 15:58:45 +0000 Subject: [PATCH] fix children with left --- src/Layout.js | 3 +-- src/__tests__/Layout-test.js | 15 +++++++++++++++ 2 files changed, 16 insertions(+), 2 deletions(-) diff --git a/src/Layout.js b/src/Layout.js index ed75ed5a..4c7dec56 100755 --- a/src/Layout.js +++ b/src/Layout.js @@ -267,8 +267,7 @@ var computeLayout = (function() { if (getAlignItem(node, child) === CSS_ALIGN_STRETCH && getPositionType(child) === CSS_POSITION_RELATIVE && !isUndefined(node.layout[dim[crossAxis]]) && - !isDimDefined(child, crossAxis) && - !isPosDefined(child, leading[crossAxis])) { + !isDimDefined(child, crossAxis)) { child.layout[dim[crossAxis]] = fmaxf( node.layout[dim[crossAxis]] - getPaddingAndBorderAxis(node, crossAxis) - diff --git a/src/__tests__/Layout-test.js b/src/__tests__/Layout-test.js index ee854146..b072d32c 100755 --- a/src/__tests__/Layout-test.js +++ b/src/__tests__/Layout-test.js @@ -1099,6 +1099,21 @@ describe('Layout', function() { ); }); + it('should layout with children of a contain with left', function() { + testLayout( + {style: {width: 800}, children: [ + {style: {left: 5}, children: [ + {style: {}} + ]} + ]}, + {width: 800, height: 0, top: 0, left: 0, children: [ + {width: 800, height: 0, top: 0, left: 5, children: [ + {width: 800, height: 0, top: 0, left: 0} + ]} + ]} + ); + }); + xit('should layout flex-wrap', function() { testLayout( {style: {flexWrap: 'wrap', flexDirection: 'row', width: 100}, children: [