Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[AutoLayout] Collapsed elements in autolayout still takes space #660

Closed
5 of 17 tasks
Marc-Antoine-Soucy opened this issue Jul 19, 2023 · 1 comment · Fixed by #663
Closed
5 of 17 tasks

[AutoLayout] Collapsed elements in autolayout still takes space #660

Marc-Antoine-Soucy opened this issue Jul 19, 2023 · 1 comment · Fixed by #663
Assignees
Labels
control/auto-layout kind/bug Something isn't working triage/untriaged Indicates an issue requires triaging or verification.

Comments

@Marc-Antoine-Soucy
Copy link
Contributor

Marc-Antoine-Soucy commented Jul 19, 2023

Current behavior

You can see this in this gif were you switch visibility between two grids. (AutoLayout to the left, StackPanel to the right)
collapsedbutnot

In this gif, where the blue grid is being collapsed, you can see that it still takes space in the AutoLayout while it doesnt in the StackPanel.

collapsedbutnot2

Expected behavior

I would expect collapsed element in an AutoLayout to stop taking space, just like they do in a StackPanel.

How to reproduce it (as minimally and precisely as possible)

	<Grid Background="{ThemeResource ApplicationPageBackgroundThemeBrush}">
		<utu:AutoLayout>
			<Grid Height="200"
				  Width="200"
				  Background="Blue"
				  Visibility="{Binding Element1Visibility}">
				<TextBlock Text="Grid in Autolayout"
						   VerticalAlignment="Center" />
			</Grid>
			<Grid Height="200"
				  Width="200"
				  Background="Red"
				  Visibility="{Binding Element2Visibility}">
				<TextBlock Text="Grid in Autolayout"
						   VerticalAlignment="Center" />
			</Grid>
		</utu:AutoLayout>
		<StackPanel Margin="200,0,0,0">
			<Grid Height="200"
				  Width="200"
				  Background="Blue"
				  Visibility="{Binding Element1Visibility}">
				<TextBlock Text="Grid in Stackpanel" 
						   VerticalAlignment="Center"/>

			</Grid>
			<Grid Height="200"
				  Width="200"
				  Background="Red"
				  Visibility="{Binding Element2Visibility}">
				<TextBlock Text="Grid in Stackpanel"
						   VerticalAlignment="Center" />
			</Grid>
		</StackPanel>


		<Button Click="Button_Click" 
				Content="Change visibility"/>
	</Grid>

BasicApp.zip
To test, just click on the button and notice the blue grid always takes space in the AutoLayout and does not in the StackPanel.

Nuget Package:

		<PackageReference Include="Uno.Toolkit.WinUI" Version="4.0.0-dev.52" />
		<PackageReference Include="Uno.WinUI" Version="5.0.0-dev.1441" />

Package Version(s):

Affected platform(s):
The bug is present on all platform tested

  • WebAssembly
  • Android
  • iOS
  • macOS (AppKit)
  • Mac Catalyst
  • Skia
    • WPF
    • GTK (Linux)
    • Linux Framebuffer
    • Tizen
  • Windows

IDE:

  • Visual Studio 2022 17.60
  • Visual Studio 2019
  • Visual Studio Code
  • Visual Studio for Mac
  • Rider Windows
  • Rider macOS

Relevant plugins:

Anything else we need to know?

@Marc-Antoine-Soucy Marc-Antoine-Soucy added kind/bug Something isn't working triage/untriaged Indicates an issue requires triaging or verification. labels Jul 19, 2023
@Robert-Louis Robert-Louis linked a pull request Jul 19, 2023 that will close this issue
6 tasks
@Robert-Louis
Copy link
Contributor

@agneszitte @Marc-Antoine-Soucy it should be fixed by this pr #663

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
control/auto-layout kind/bug Something isn't working triage/untriaged Indicates an issue requires triaging or verification.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants