Skip to content

[Android] [iOS] Grid with MinWidths summing to greater than container Width isn't clipped #1885

Closed

Description

@carldebilly

Bug Report

Take the following XAML:

<Border Width="350" Height="350" BorderBrush="Red" BorderThickness="2">
	<Grid>
		<Grid.ColumnDefinitions>
			<ColumnDefinition MinWidth="150" />
			<ColumnDefinition MinWidth="150" />
			<ColumnDefinition MinWidth="150" />
		</Grid.ColumnDefinitions>

		<Rectangle Grid.Column="0" Fill="LightBlue" />
		<Rectangle Grid.Column="1" Fill="LightGreen" />
		<Rectangle Grid.Column="2" Fill="LightGray" />

		<TextBlock Grid.ColumnSpan="2" FontWeight="Bold" FontSize="20" TextWrapping="WrapWholeWords" Padding="10">
			3 columns of MinWidth=150 in a 350px wide border (red border)
			- they should be aligned with central darker rectangles.
		</TextBlock>

		<StackPanel Height="40" Grid.ColumnSpan="3" VerticalAlignment="Center" Orientation="Horizontal">
			<Rectangle Width="150" Fill="Blue" />
			<Rectangle Width="150" Fill="Green" />
			<Rectangle Width="150" Fill="Gray" />
		</StackPanel>
	</Grid>
</Border>

Current behavior

It's crashing the app on all Uno platforms.

Last rectangle isn't clipped.

Expected behavior

Shoud render corectly, following the rules described in it. Content should be clipped.

Affected platform(s):

  • iOS
  • Android
  • WebAssembly

Sample

The sample Grid_with_MinWidthColumns illustrate the problem well.

Regression

It's a regression because it's not crashing on the playground: https://playground.platform.uno/#ad18ce45 (but not rendered correctly)

Activity

  1. added
    kind/bug
    help wanted
    platform/wasm 🌐
    platform/android 🤖
    platform/ios 🍎
    kind/regression
    hacktoberfest
    on Oct 17, 2019
  2. kazo0 commented on Oct 20, 2019

    @kazo0
    Contributor

    For what it's worth, I am unable to repro this crash on any platform with latest master SamplesApp. Only thing I notice is that nothing seems to render for the WASM sample.

  3. kazo0 commented on Oct 20, 2019

    @kazo0
    Contributor

    I did notice that the grid isn't being clipped on Android

  4. davidjohnoliver commented on Dec 19, 2019

    @davidjohnoliver
    Contributor

    Confirmed that the clipping is incorrect on Android and iOS (but correct on WASM).

    Seems that UWP gives the Grid a DesiredSize <= than the outer Border size, but the ActualWidth is wider than the outer Border.

  5. changed the title [-]Using MinWidth on Grid's ColumnDefinition could crash the app[/-] [+][Android] [iOS] Grid with MinWidths summing to greater than container Width isn't clipped[/+] on Dec 19, 2019
  6. removed their assignment
    on Dec 19, 2019
  7. self-assigned this
    on Jan 30, 2020
  8. carldebilly commented on Feb 4, 2020

    @carldebilly
    MemberAuthor

    It has not been tested yet, but the package Uno.UI v2.1.0-dev.1090 contains fixes related to this issue and it should be tested again on this version.

  9. modified the milestone: 3.1 on Aug 29, 2020
  10. removed their assignment
    on Sep 17, 2020
  11. added
    project/layout 🧱
    on Sep 21, 2020
  12. added
    area/grid
    on Oct 8, 2020
  13. added
    difficulty/tbd
    on Feb 15, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    area/griddifficulty/tbdhacktoberfesthelp wantedkind/bugkind/regressionplatform/android 🤖platform/ios 🍎platform/wasm 🌐project/layout 🧱

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions