-
Notifications
You must be signed in to change notification settings - Fork 1.9k
[Android] Fix WebView in a grid expands beyond it's cell #32145
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
base: main
Are you sure you want to change the base?
[Android] Fix WebView in a grid expands beyond it's cell #32145
Conversation
|
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. |
|
/azp run MAUI-UITests-public |
|
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); |
There was a problem hiding this comment.
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/"
There was a problem hiding this comment.
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).
There was a problem hiding this comment.
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.

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
This fix resolves both the layout overflow and unwanted event trigger issues.
Issues Fixed
Fixes #32030
Tested the behavior in the following platforms.