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

Flickering Issue When Toggling WebView Visibility in Grid Layout on Android #24113

Open
kellymmcd opened this issue Aug 8, 2024 · 4 comments · May be fixed by #24753
Open

Flickering Issue When Toggling WebView Visibility in Grid Layout on Android #24113

kellymmcd opened this issue Aug 8, 2024 · 4 comments · May be fixed by #24753
Labels
area-layout StackLayout, GridLayout, ContentView, AbsoluteLayout, FlexLayout, ContentPresenter layout-grid p/1 Work that is important, and has been scheduled for release in this or an upcoming sprint platform/android 🤖 s/triaged Issue has been reviewed s/verified Verified / Reproducible Issue ready for Engineering Triage t/bug Something isn't working
Milestone

Comments

@kellymmcd
Copy link

Description

In Android when changing the visibility of a WebView within a grid I'm getting an issue where the elements underneath the grid start flickering as seen in video below.

2024-08-09_11-23-40.mp4

Steps to Reproduce

  1. Create a new .NET MAUI app.
  2. Add the following XAML code in MainPage.xaml:
<ScrollView>
    <Grid RowDefinitions="50,Auto,185,40"
        Padding="30,0">
        <Button
            Grid.Row="0"
            Text="Click me" 
            Clicked="OnClicked"
            HorizontalOptions="Fill" />
        <WebView
               x:Name="webView"
               IsVisible="False"
               Grid.Row="1">
            <WebView.Source>
                <HtmlWebViewSource>
                    <HtmlWebViewSource.Html>
                        <![CDATA[
                        <HTML>
                        <BODY>
                        <H1>.NET MAUI</H1>
                        <P>Welcome to WebView.</P>
                        </BODY>
                        </HTML>
                        ]]>
                    </HtmlWebViewSource.Html>
                </HtmlWebViewSource>
            </WebView.Source>
        </WebView>
        <Image
             Grid.Row="2"
             Source="dotnet_bot.png"
             HeightRequest="185"
             Aspect="AspectFit"
             SemanticProperties.Description="dot net bot in a race car number eight" />

        <Label
             Grid.Row="3"
             Text="Hello, World!"
             Style="{StaticResource Headline}"
             SemanticProperties.HeadingLevel="Level1" />
    </Grid>
</ScrollView>

  1. In the code-behind (MainPage.xaml.cs), add the following method:
  private void OnClicked(object sender, EventArgs e)
  {
     webView.IsVisible = !webView.IsVisible;
  }
  1. Run the app on a Android physical device or an emulator
  2. Click the button to toggle the WebView visibility on and off.

Link to public reproduction project repository

No response

Version with bug

8.0.80 SR8

Is this a regression from previous behavior?

Not sure, did not test other versions

Last version that worked well

Unknown/Other

Affected platforms

Android

Affected platform versions

No response

Did you find any workaround?

Setting a height request on the WebView prevents this from happening. However in my scenario I don't know the height of the contents in the WebView to set this.

Relevant log output

No response

@kellymmcd kellymmcd added the t/bug Something isn't working label Aug 8, 2024
Copy link
Contributor

github-actions bot commented Aug 8, 2024

Hi I'm an AI powered bot that finds similar issues based off the issue title.

Please view the issues below to see if they solve your problem, and if the issue describes your problem please consider closing this one and thumbs upping the other issue to help us prioritize it. Thank you!

Open similar issues:

Closed similar issues:

Note: You can give me feedback by thumbs upping or thumbs downing this comment.

@ninachen03 ninachen03 added s/verified Verified / Reproducible Issue ready for Engineering Triage s/triaged Issue has been reviewed i/regression This issue described a confirmed regression on a currently supported version labels Aug 9, 2024
@ninachen03
Copy link

ninachen03 commented Aug 9, 2024

Updated result
Verified it again on latest 17.12.0 Preview 1.0 (8.0.80&8.0.71&8.0.61&8.0.3) and also repro in build 17.11.0 NET 7
MauiApp29.zip

@PureWeen PureWeen added the p/0 Work that we can't release without label Aug 9, 2024
@PureWeen PureWeen added this to the .NET 8 SR8 milestone Aug 9, 2024
@PureWeen PureWeen assigned samhouts and unassigned samhouts Aug 15, 2024
@PureWeen
Copy link
Member

@ninachen03 can you validate this one again against older versions of MAUI?

I've tested back to 8.0.60 and I'm still seeing the same issue mentioned

@PureWeen PureWeen added p/1 Work that is important, and has been scheduled for release in this or an upcoming sprint potential-regression This issue described a possible regression on a currently supported version., verification pending and removed p/0 Work that we can't release without i/regression This issue described a confirmed regression on a currently supported version labels Aug 19, 2024
@PureWeen PureWeen modified the milestones: .NET 8 SR8, Backlog Aug 19, 2024
@PureWeen PureWeen removed the s/triaged Issue has been reviewed label Aug 19, 2024
@ninachen03
Copy link

@PureWeen I verified it again on latest 17.12.0 Preview 1.0 (8.0.80&8.0.71&8.0.61&8.0.3) and also repro in build 17.11.0 NET 7 SDK.
24113

@ninachen03 ninachen03 added s/triaged Issue has been reviewed and removed potential-regression This issue described a possible regression on a currently supported version., verification pending labels Aug 22, 2024
@samhouts samhouts added area-layout StackLayout, GridLayout, ContentView, AbsoluteLayout, FlexLayout, ContentPresenter layout-grid labels Aug 28, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area-layout StackLayout, GridLayout, ContentView, AbsoluteLayout, FlexLayout, ContentPresenter layout-grid p/1 Work that is important, and has been scheduled for release in this or an upcoming sprint platform/android 🤖 s/triaged Issue has been reviewed s/verified Verified / Reproducible Issue ready for Engineering Triage t/bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants