Skip to content

Conversation

devanathan-vaithiyanathan
Copy link
Contributor

Note

Are you waiting for the changes in this PR to be merged?
It would be very helpful if you could test the resulting artifacts from this PR and let us know in a comment if this change resolves your issue. Thank you!

Issue Details

After PR #29234 , the else part was removed to stop the Navigated event from triggering when the WebView had no source.
However, this caused a new issue where rendering a WebView without a source exceeded the layout bounds.

Root Cause

When the WebView was rendered without a source, the layout logic was not properly handled — causing the WebView to exceed its layout bounds.

Description of Change

  • Reintroduced the else part.
  • Added a check to skip the Navigated event when the source is the default (empty).

This fix resolves both the layout overflow and unwanted event trigger issues.

Issues Fixed

Fixes #32030

Tested the behavior in the following platforms.

  • Android
  • Windows
  • iOS
  • Mac
Before After
Android
Android

@dotnet-policy-service dotnet-policy-service bot added the community ✨ Community Contribution label Oct 22, 2025
@dotnet-policy-service
Copy link
Contributor

Hey there @@devanathan-vaithiyanathan! Thank you so much for your PR! Someone from the team will get assigned to your PR shortly and we'll get it reviewed.

@dotnet-policy-service dotnet-policy-service bot added the partner/syncfusion Issues / PR's with Syncfusion collaboration label Oct 22, 2025
@jsuarezruiz
Copy link
Contributor

/azp run MAUI-UITests-public

@azure-pipelines
Copy link

Azure Pipelines successfully started running 1 pipeline(s).

return false;

// Check if URL is about:blank (case insensitive)
return string.Equals(url.Trim(), "about:blank", StringComparison.OrdinalIgnoreCase);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could expand to more variants?

Examples:

  • "about:blank#"
  • "about:blank/"

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This will be invoked on every Navigation. The impact on performance now is minimal for the current simple string comparison, but take this into account (for example, if think in use URI parsing or more complex stuff).

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@jsuarezruiz , When the source is null, we set the default WebView source to about:blank. As a result, the OnPageFinished method always receives about:blank as the parameter. Therefore, handling additional variants such as about:blank# or about:blank/ is not necessary in this case.
image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area-controls-webview WebView community ✨ Community Contribution partner/syncfusion Issues / PR's with Syncfusion collaboration platform/android

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Android - WebView in a grid expands beyond it's cell

2 participants