Skip to content

[regression/7.0.81] Grid can't use star and auto together in version 7.0.81 #14520

@tom-b-iodigital

Description

@tom-b-iodigital

Discussed in #14519

Description

When you make a grid with a column(row)definition that is set to auto and another one that is set to *, and the grid is a child of a stacklayout the grid measurement calculations are wrong

Steps to Reproduce

  1. create a new MAUI project following the default template
  2. Replace the label with
<Grid>
    <Grid.ColumnDefinitions>
        <ColumnDefinition Width="auto"></ColumnDefinition>
        <ColumnDefinition Width="*"></ColumnDefinition>
    </Grid.ColumnDefinitions>

    <BoxView Color="Red" WidthRequest="20"></BoxView>
    
    <Label
        Grid.Column="1"
        Text="Welcome to .NET Multi-platform App UI"
        SemanticProperties.HeadingLevel="Level2"
        SemanticProperties.Description="Welcome to dot net Multi platform App U I"
        FontSize="18"
        HorizontalOptions="Center" />
</Grid>
  1. run the app and notice the label is not being shown at all
  2. change "auto" to 20 and run again, the label and boxview are shown correctly

These steps seems simple and clear enough, so I didn't provide a repro project yet. If needed I can upload one later

Link to public reproduction project repository

https://github.com/tom-b-iodigital/maui-gridbug

Version with bug

7.0.81

Last version that worked well

7.0.59

Affected platforms

iOS, Android, I was not able test on other platforms

Affected platform versions

All versions

Did you find any workaround?

Setting the column defined with auto to a fixed width fixes the problem, however this is not always possible in complex layouts

Relevant log output

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    area-layoutStackLayout, GridLayout, ContentView, AbsoluteLayout, FlexLayout, ContentPresenteri/regressionThis issue described a confirmed regression on a currently supported versionlayout-gridp/1Work that is important, and has been scheduled for release in this or an upcoming sprintplatform/androidplatform/ioss/duplicate 2️⃣This issue or pull request already existst/bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions