Skip to content

Collapsed element affects layout in Flexbox #8582

@Whip

Description

@Whip

Environment
Provide version numbers for the following components (information can be retrieved by running tns info in your project folder or by inspecting the package.json of the project):

  • CLI: 6.5.0
  • Cross-platform modules: 6.5.0
  • Android Runtime: 6.5.1
  • iOS Runtime: 6.5.1

Describe the bug
In a flexbox layout I want two elements to be on opposite edges of the screen so I use justifyContent="space-between" to accomplish that. It works fine when there are just two elements but if there's a third element in collapsed visibility, it makes the layout different (screenshot below).

If the third element is collapsed, it shouldn't really affect the layout, right?

To Reproduce

<FlexboxLayout flexDirection="column" justifyContent="space-between" alignItems="center" backgroundColor="#CCC">
	<AbsoluteLayout height="300" width="300" backgroundColor="green">
	</AbsoluteLayout>

	<AbsoluteLayout height="300" width="300" visibility="collapsed" backgroundColor="blue">
	</AbsoluteLayout>

	<GridLayout columns="*,*" height="70" backgroundColor="red">
		<StackLayout col="0" padding="5">
			<Button class="-outline" tap="profile" text="My Profile" />
		</StackLayout>
		<StackLayout col="1" padding="5">
			<Button class="-outline" tap="logout" text="Logout" />
			</Button>
		</StackLayout>
	</GridLayout>
</FlexboxLayout>

This results is
Screenshot_20200516-161937

Expected behavior
Screenshot_20200516-161950

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions