dotnet / dotnet/maui

[Windows] WebView doesn't display url when inside a VerticalStackLayout

Open
#10,195 5 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

area-controls-webview area-layout layout-stack platform/windows s/triaged s/verified t/bug
Dominant language
C#
Stars
23.3k
Forks
2k
Avg merge
1d 14h
Merged PRs (30d)
296

Description

Description

I recently decided to change the StackLayout to VerticalStackLayout.
If I place a WebView control within a VerticalStackLayout. the web page at Source is not displayed. If I replace the VerticalStackLayout with StackLayout, the web page is displayed.
Works fine on Android 12.1 - API 32.

WebViewTest.zip

Steps to Reproduce
  1. Compile and run attached project as a Windows app on Windows 11. The project contains 2 pages. They are identical except one uses StackLayout and the other VerticalStackLayout.
  2. Select "Display a Web page using StackLayout". This page will work as expected
  3. Select "Display a Web page using VerticalStackLayout". This page will not work as expected
Link to public reproduction project repository

https://github.com/dotnet/maui/files/9595317/WebViewTest.zip

Version with bug

6.0.486 (current)

Last version that worked well

Unknown/Other

Affected platforms

Windows

Affected platform versions

Microsoft Visual Studio Community 2022 (64-bit) - Preview Version 17.4.0 Preview 2.0 on Windows 11

Did you find any workaround?

Use StackLayout instead of VerticalStackLayout

Relevant log output

No response

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with the attached WebViewTest.zip and run its two pages as a Windows app on Windows 11, comparing the StackLayout and VerticalStackLayout cases. Trace the Windows WebView and layout behavior, then verify that the page from Source displays inside VerticalStackLayout without regressing the working StackLayout case.

Written by the indexing model from the issue text.

Assessment

Tech stack
csharp
Domain
desktop, frontend
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Quiet
Clarity
Mostly clear
Newbie friendliness
48/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.