fix bug where nested align: stretch were not properly working
The way the algorithm work is that you first layout fixed children on the main axis, then compute all the dimensions so that you can layout flexible children. This separation doesn't work anymore if we add the other axis. The solution here is a hacky (but working!) attempt at fixing the issue. We start by doing a pass to set the children dimensions if they are stretch.
This commit is contained in:
@@ -777,7 +777,20 @@ describe('Layout', function() {
|
||||
)
|
||||
});
|
||||
|
||||
|
||||
it('should layout node with nested alignSelf: stretch', function() {
|
||||
testLayout(
|
||||
{style: {width: 300}, children: [
|
||||
{style: {alignSelf: 'stretch'}, children: [
|
||||
{style: {alignSelf: 'stretch'}}
|
||||
]}
|
||||
]},
|
||||
{width: 300, height: 0, top: 0, left: 0, children: [
|
||||
{width: 300, height: 0, top: 0, left: 0, children: [
|
||||
{width: 300, height: 0, top: 0, left: 0}
|
||||
]}
|
||||
]}
|
||||
);
|
||||
});
|
||||
|
||||
it('should layout randomly', function() {
|
||||
function RNG(seed) {
|
||||
|
Reference in New Issue
Block a user