flex > height in case of conflict

This commit is contained in:
Christopher Chedeau
2014-04-06 19:21:06 -07:00
parent 5d8d13b05b
commit a91915d8d2
2 changed files with 15 additions and 1 deletions

View File

@@ -352,5 +352,19 @@ describe('Layout', function() {
});
});
it('should layout node with flex override height', function() {
testLayout({
style: {width: 1000, height: 1000},
children: [
{style: {width: 100, height: 100, flex: 1}},
]
}, {
width: 1000, height: 1000, top: 0, left: 0,
children: [
{width: 100, height: 1000, top: 0, left: 0}
]
});
});
});

View File

@@ -80,7 +80,7 @@ function computeLayout(node) {
var children = node.children || emptyArray;
var mainDimInStyle = dim[mainAxis] in node.style;
if (mainDimInStyle) {
if (node.layout[dim[mainAxis]] === undefined && mainDimInStyle) {
node.layout[dim[mainAxis]] = node.style[dim[mainAxis]];
}