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

WebView in ContentDialog does not work. #6427

Closed
1 of 2 tasks
HppZ opened this issue Dec 2, 2021 · 8 comments
Closed
1 of 2 tasks

WebView in ContentDialog does not work. #6427

HppZ opened this issue Dec 2, 2021 · 8 comments
Labels
area-WebView duplicate This issue or pull request already exists team-Rendering Issue for the Rendering team

Comments

@HppZ
Copy link

HppZ commented Dec 2, 2021

Describe the bug

links buttons in webview are not clickable.

Steps to reproduce the bug

1, run the demo in release mode.
2, click links in webview (not clickable).
3, after remove <XamlControlsResources xmlns="using:Microsoft.UI.Xaml.Controls" />, it works.

BUG.zip

Expected behavior

No response

Screenshots

image

NuGet package version

Microsoft.UI.Xaml 2.7.0

Windows app type

  • UWP
  • Win32

Device form factor

Desktop

Windows version

October 2020 Update (19042)

Additional context

No response

@ghost ghost added the needs-triage Issue needs to be triaged by the area owners label Dec 2, 2021
@Link1J
Copy link

Link1J commented Jan 10, 2022

Reporting two unrelated thing as one bug.

I can't replicate the WebView bug mentioned in the title on Windows 11. In seems to be behaving correctly and opening the links in the browser. It is possible that you have uninstalled Edge, which could create problems like the one you are seeing.

The ContentDialog not changing size is not a bug with WinUI2 or the System XAML. In fact it is working as you asked. Maybe don't set the MaxWidth of the ContentDialog.

@HppZ
Copy link
Author

HppZ commented Jan 27, 2022

@chingucoding HELP PLEASE.

@HppZ
Copy link
Author

HppZ commented Jan 27, 2022

Reporting two unrelated thing as one bug.

I can't replicate the WebView bug mentioned in the title on Windows 11. In seems to be behaving correctly and opening the links in the browser. It is possible that you have uninstalled Edge, which could create problems like the one you are seeing.

The ContentDialog not changing size is not a bug with WinUI2 or the System XAML. In fact it is working as you asked. Maybe don't set the MaxWidth of the ContentDialog.

after remove <XamlControlsResources xmlns="using:Microsoft.UI.Xaml.Controls" />, links are clickable.

@marcelwgn
Copy link
Collaborator

So it seems that the corner radius being set with the WinUI styles is causing this issue. If you add the following to your ButtonBase_OnClick function before opening the content dialog, it works (note that you need to use the API contract since CornerRadius is not available on every Windows 10 version):

if(ApiInformation.IsApiContractPresent("Windows.Foundation.FoundationContract", 7))
{
    _verificationDialog.CornerRadius = new CornerRadius(0);
}

Screenshot of WebView working inside a ContentDialog

@HppZ
Copy link
Author

HppZ commented Feb 14, 2022

So it seems that the corner radius being set with the WinUI styles is causing this issue. If you add the following to your ButtonBase_OnClick function before opening the content dialog, it works (note that you need to use the API contract since CornerRadius is not available on every Windows 10 version):

if(ApiInformation.IsApiContractPresent("Windows.Foundation.FoundationContract", 7))
{
    _verificationDialog.CornerRadius = new CornerRadius(0);
}

Screenshot of WebView working inside a ContentDialog

@chingucoding when will you fix it please?

@marcelwgn
Copy link
Collaborator

@HppZ I am not working for Microsoft so I can't tell you when this will be fixed. The problem is that the issue probably somewhere in WebView which means there isn't much one can do here beside using the workaround.

@HppZ
Copy link
Author

HppZ commented Feb 15, 2022

@HppZ I am not working for Microsoft so I can't tell you when this will be fixed. The problem is that the issue probably somewhere in WebView which means there isn't much one can do here beside using the workaround.

@chingucoding Thank you.

@StephenLPeters
Copy link
Contributor

This is a duplicate of #5299 The issue is in system xaml and has been fixed for later versions of windows however is still present for some Win10 versions. Resolving this issue is challenging and Chingucoding's suggestion of removing the corner radius is the best work around we have.

@ghost ghost removed the needs-triage Issue needs to be triaged by the area owners label Feb 24, 2022
@StephenLPeters StephenLPeters added area-WebView duplicate This issue or pull request already exists team-Rendering Issue for the Rendering team labels Feb 24, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area-WebView duplicate This issue or pull request already exists team-Rendering Issue for the Rendering team
Projects
None yet
Development

No branches or pull requests

4 participants