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

[regression/7.0.86] [iOS/Catalyst] Grid issue with calculating * values on iOS/MacCatalyst #15018

Closed
Dokug opened this issue May 10, 2023 · 9 comments · Fixed by #15143
Closed
Assignees
Labels
area-layout StackLayout, GridLayout, ContentView, AbsoluteLayout, FlexLayout, ContentPresenter fixed-in-8.0.0-preview.5.8529 Look for this fix in 8.0.0-preview.5.8529! i/regression This issue described a confirmed regression on a currently supported version layout-grid platform/iOS 🍎 t/bug Something isn't working

Comments

@Dokug
Copy link

Dokug commented May 10, 2023

Description

In the sample below you will find that a red Boxview, that should be inside the bounds of the green grid, is outside the limitations of its parent grid when the application starts.

This affects only MacCatalyst and iOS.
On Windows it works as expected, I did not test it on Android.

image




Affected version: 7.0.86
Last version that worked: 7.0.81

Tested using the latest stable version of VS Mac (17.5.4, build 8)

Steps to Reproduce

Replace the MainPage.xaml of a new MAUI project with the following:

<?xml version="1.0" encoding="utf-8" ?>
<ContentPage xmlns="http://schemas.microsoft.com/dotnet/2021/maui"
             xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
             x:Class="MAUI_Bug.MainPage">

    <Grid
        ColumnDefinitions="630, *"
        RowDefinitions="48, *"
        Background="Gray">
        
        <Grid
            ColumnDefinitions="*, 48"
            ColumnSpacing="16"
            Background="Green"
            Padding="16, 0, 0, 0">
            
            <BoxView Grid.ColumnSpan="2"
                     VerticalOptions="Start"
                     HeightRequest="2"
                     Color="Yellow"/>

            <Grid Grid.Column="1">
                <BoxView
                    HeightRequest="24"
                    WidthRequest="24"
                    Opacity="0.8"
                    Color="Red" />
            </Grid>
        </Grid>
    </Grid>
</ContentPage>

Observe that the red boxview moves inside the bounds of its grid when the yellow boxview is deleted and re-added (with undo) with the app running hot reload active.

Link to public reproduction project repository

See the "steps to reproduce" section.

Version with bug

Unknown/Other (please specify)

Last version that worked well

Unknown/Other

Affected platforms

iOS, macOS

Affected platform versions

iOS/MacCatalyst

Did you find any workaround?

What curiously works is setting the ColumnDefinitions of the 2nd (green) grid from "*, 48" to "550, 48", which does not make sense to me, as the green grid should have a total width of 630 (as defined by the column on the parent - gray - grid).
However 550+48 obviously comes out to 598.

Relevant log output

No response

@Dokug Dokug added the t/bug Something isn't working label May 10, 2023
@Eilon Eilon added the area-layout StackLayout, GridLayout, ContentView, AbsoluteLayout, FlexLayout, ContentPresenter label May 10, 2023
@JonnySKK
Copy link

JonnySKK commented May 10, 2023

We are also seeing this issue as of 7.0.86, we've had to roll back to 7.0.81 as a result

Happening on portrait mode in iOS

@FM1973
Copy link

FM1973 commented May 10, 2023

I can confirm this.
"Hotfix" 7.0.86 completely destroyed grid behavior on IOS although it should address grid problems.
Instead of having problems with row heights, now we have problems with columns...
Had to go back to 7.0.59
I hope we will not have to wait another X weeks for a fix. Sorry, but this is really annoying.

@Dokug Dokug changed the title Grid issue with calculating * values on iOS/MacCatalyst [iOS/Catalys] Grid issue with calculating * values on iOS/MacCatalyst May 10, 2023
@Dokug Dokug changed the title [iOS/Catalys] Grid issue with calculating * values on iOS/MacCatalyst [iOS/Catalyst] Grid issue with calculating * values on iOS/MacCatalyst May 10, 2023
@mattleibow mattleibow added the i/regression This issue described a confirmed regression on a currently supported version label May 10, 2023
@mattleibow mattleibow added this to the Backlog milestone May 10, 2023
@Redth
Copy link
Member

Redth commented May 10, 2023

@hartez
Copy link
Contributor

hartez commented May 10, 2023

@Dokug can you add a screenshot of what it's supposed to look like?

Also, I'm guessing this with the device in landscape mode?

@Dokug
Copy link
Author

Dokug commented May 10, 2023

Sure, the expected result would look like this:
image

The screenshots are from a Mac, so yes, the screen is in landscape mode.
I'd have to test if there is any difference on the iPad between portrait and landscape.

@faheys
Copy link
Contributor

faheys commented May 11, 2023

I can confirm this. "Hotfix" 7.0.86 completely destroyed grid behavior on IOS although it should address grid problems. Instead of having problems with row heights, now we have problems with columns... Had to go back to 7.0.59 I hope we will not have to wait another X weeks for a fix. Sorry, but this is really annoying.

If you don't mind me asking how did you go about rolling back to a previous MAUI workload version? I can't find any documentation on how to do it.

@Dokug
Copy link
Author

Dokug commented May 11, 2023

I can confirm this. "Hotfix" 7.0.86 completely destroyed grid behavior on IOS although it should address grid problems. Instead of having problems with row heights, now we have problems with columns... Had to go back to 7.0.59 I hope we will not have to wait another X weeks for a fix. Sorry, but this is really annoying.

If you don't mind me asking how did you go about rolling back to a previous MAUI workload version? I can't find any documentation on how to do it.

An officially unsupported method, that works nevertheless, is to include (for example)
<MauiVersion>7.0.81</MauiVersion>
in your MAUI .csproj file.

Make sure to clean the project before building with another MAUI version.

@JonnySKK
Copy link

JonnySKK commented Jun 7, 2023

Aware the PR for this (#15143) was merged into main, can we assume this will be backported into the next .NET 7 Service release? We are stuck on 7.0.81 until the grid issues are fixed, but there's been no mention of this being backported despite the widely reported grid issues in 7.0.86. rmarinho hartez

@ghost
Copy link

ghost commented Jun 7, 2023

Hello lovely human, thank you for your comment on this issue. Because this issue has been closed for a period of time, please strongly consider opening a new issue linking to this issue instead to ensure better visibility of your comment. Thank you!

@samhouts samhouts added the fixed-in-8.0.0-preview.5.8529 Look for this fix in 8.0.0-preview.5.8529! label Jun 21, 2023
@dotnet dotnet locked as resolved and limited conversation to collaborators Jul 28, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
area-layout StackLayout, GridLayout, ContentView, AbsoluteLayout, FlexLayout, ContentPresenter fixed-in-8.0.0-preview.5.8529 Look for this fix in 8.0.0-preview.5.8529! i/regression This issue described a confirmed regression on a currently supported version layout-grid platform/iOS 🍎 t/bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

9 participants