Skip to content
New issue

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

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

Already on GitHub? # to your account

Page not rendering when using SafeArea, Grid with Auto, and ScrollView #27748

Open
JohnTraDolta opened this issue Feb 12, 2025 · 5 comments
Open
Labels
area-controls-scrollview ScrollView platform/iOS 🍎 s/triaged Issue has been reviewed s/verified Verified / Reproducible Issue ready for Engineering Triage t/bug Something isn't working

Comments

@JohnTraDolta
Copy link

Description

A page in our .NET MAUI application does not render properly when using a combination of SafeArea, Grid with Auto row definitions, and ScrollView. Initially, it seemed device-dependent, but the issue has been reproduced consistently with a minimal setup. Not all of our users is affected by this, but if they are it can be reproduced every time.

From what i've seen, no error is thrown and no error or warning is printed. Only the UI freezes and my guess is there is some infinite loop running in the layout process.

We have tested with dotnet 8 and 9 multiple versions.

Steps to Reproduce

Steps to reproduce:
pull and run the project
or copy paste problematic xaml

<ContentPage
    x:Class="IOSStrangeMauiBug.MainPage"
    xmlns="http://schemas.microsoft.com/dotnet/2021/maui"
    xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
    >
    <Grid IgnoreSafeArea="True" RowDefinitions="auto, *">
        <StackLayout Background="blue" IgnoreSafeArea="True">
            <Label Text="Stack layout label" />
        </StackLayout>
        <ScrollView Grid.Row="1">
            <Label Text="Scroll view label" />
        </ScrollView>
    </Grid>
</ContentPage>

Expected Behavior:
The page should be render.

Actual Behavior:
The page does not render at all and UI thread is frozen.

Link to public reproduction project repository

https://github.com/JohnTraDolta/IOSStrangeMauiBug

Version with bug

9.0.40 SR4

Is this a regression from previous behavior?

Not sure, did not test other versions

Last version that worked well

Unknown/Other

Affected platforms

iOS

Affected platform versions

No response

Did you find any workaround?

Workarounds: (do one of the following)
Change RowDefinition from Auto to *
Remove ScrollView
Remove IgnoreSafeArea="True"

Relevant log output

@JohnTraDolta JohnTraDolta added the t/bug Something isn't working label Feb 12, 2025
@JohnTraDolta JohnTraDolta changed the title Page not rendering for some users when using SafeArea, Grid with Auto, and ScrollView Page not rendering when using SafeArea, Grid with Auto, and ScrollView Feb 12, 2025
@PureWeen
Copy link
Member

I bet it's related to this

#24246

I still haven't quite cracked this one :-/

@JohnTraDolta
Copy link
Author

@PureWeen
It´s sounds like it, was you able to get your example to render?

The odd thing about this issue is that the same page renders on some devices but not others. We were not able to reproduce our production issue with in-house devices. So I visited a customer yesterday, who had the issue, and got it to work there.
After i got back to work i made a new app trying to reproduce the problem, and with this demo app i can reproduce on all devices.

What I saw on the customer's device, was that the app froze. This was the login page so pretty critical for us and our customers.

Don't think this will help in any way, but I find it kind of interesting.

If you need more from me don't hesitate to reach out!

@jsuarezruiz
Copy link
Contributor

Could be fixed by #27043?

Can include:

<ContentPage
    x:Class="IOSStrangeMauiBug.MainPage"
    xmlns="http://schemas.microsoft.com/dotnet/2021/maui"
    xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
    >
    <Grid IgnoreSafeArea="True" RowDefinitions="auto, *">
        <StackLayout Background="blue" IgnoreSafeArea="True">
            <Label Text="Stack layout label" />
        </StackLayout>
        <ScrollView Grid.Row="1">
            <Label Text="Scroll view label" />
        </ScrollView>
    </Grid>
</ContentPage>

as a sample to create an UITest verifying the UI?

@Ying-6 Ying-6 added s/verified Verified / Reproducible Issue ready for Engineering Triage s/triaged Issue has been reviewed labels Feb 13, 2025
@Marnie-Majait
Copy link

Marnie-Majait commented Feb 13, 2025

This issue has been verified using Visual Studio 17.14 Preview 1(9.0.40 & 9.0.30 & 9.0.22 & 9.0.0). Can repro this issue on iOS platform.

Actual behavior:

Image

Expected behavior:

Image

@JohnTraDolta
Copy link
Author

Could be fixed by #27043?

Can include:

<ContentPage
    x:Class="IOSStrangeMauiBug.MainPage"
    xmlns="http://schemas.microsoft.com/dotnet/2021/maui"
    xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
    >
    <Grid IgnoreSafeArea="True" RowDefinitions="auto, *">
        <StackLayout Background="blue" IgnoreSafeArea="True">
            <Label Text="Stack layout label" />
        </StackLayout>
        <ScrollView Grid.Row="1">
            <Label Text="Scroll view label" />
        </ScrollView>
    </Grid>
</ContentPage>

as a sample to create an UITest verifying the UI?

@jsuarezruiz Is this something I should respond to?

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
area-controls-scrollview ScrollView platform/iOS 🍎 s/triaged Issue has been reviewed s/verified Verified / Reproducible Issue ready for Engineering Triage t/bug Something isn't working
Projects
Status: Todo
Development

No branches or pull requests

5 participants