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

[Windows] WebView2 not handling DOM events properly #22697

Closed
sreiss opened this issue May 29, 2024 · 8 comments
Closed

[Windows] WebView2 not handling DOM events properly #22697

sreiss opened this issue May 29, 2024 · 8 comments
Assignees
Labels
area-controls-webview WebView fixed-in-9.0.10 i/regression This issue described a confirmed regression on a currently supported version partner/cat 😻 this is an issue that impacts one of our partners or a customer our advisory team is engaged with platform/windows 🪟 s/triaged Issue has been reviewed s/verified Verified / Reproducible Issue ready for Engineering Triage t/bug Something isn't working

Comments

@sreiss
Copy link

sreiss commented May 29, 2024

Description

Starting from MAUI 8.0.14 and WindowsAppSDK 1.4.240211001, DOM events fired inside WebView2 are not handled properly, making the use of custom select boxes (for instance) impossible.

Steps to Reproduce

  1. Click on the app selector icon.
  2. Click on any link to be redirected to any Google app.
  3. The menu closes and the navigation is not done.
  4. What should have happenend : the navigation to the selected Google app should have been done.

Annotation 2024-05-29 084638
Annotation 2024-05-29 084642

This has been happening since 8.0.14, but still is an issue in 8.0.40. To check this sample against 8.0.40, please update the csproj package references like so:

<PackageReference Include="Microsoft.Maui.Controls" Version="8.0.40" />
<PackageReference Include="Microsoft.Maui.Controls.Compatibility" Version="8.0.40" />
<PackageReference Include="Microsoft.Extensions.Logging.Debug" Version="8.0.0" />
<PackageReference Include="Microsoft.WindowsAppSDK" Version="1.5.240311000" />

Link to public reproduction project repository

https://github.com/sreiss/maui-8.0.14-webview-events-issue/tree/main

Version with bug

8.0.14 SR3.1

Is this a regression from previous behavior?

Yes, this used to work in .NET MAUI

Last version that worked well

8.0.7 SR2

Affected platforms

Windows

Affected platform versions

Microsoft.WindowsAppSDK 1.4.240211001 to 1.5.240311000

Did you find any workaround?

No response

Relevant log output

No response

@sreiss sreiss added the t/bug Something isn't working label May 29, 2024
Copy link
Contributor

@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 May 29, 2024
@ninachen03
Copy link

Verified this issue with Visual Studio 17.11.0 Preview 1.0 ( 8.0.40 & 8.0.7 )

image

@jsuarezruiz
Copy link
Contributor

Verified on main branch too.

@BenBtg
Copy link
Contributor

BenBtg commented May 29, 2024

This need to be tagged as a XamCat issue.

@Redth Redth added the partner/cat 😻 this is an issue that impacts one of our partners or a customer our advisory team is engaged with label May 29, 2024
@Foda Foda self-assigned this May 29, 2024
@Foda
Copy link
Member

Foda commented May 29, 2024

Hello! I just confirmed that this is an issue with Webview2 and not MAUI. I've filed a bug for this here: MicrosoftEdge/WebView2Feedback#4598

@sreiss
Copy link
Author

sreiss commented Jun 11, 2024

Hi,

After checking the sample against https://www.nuget.org/packages/Microsoft.WindowsAppSDK/1.6.240531000-experimental1, I can confirm that the issue is solved by this version of the WindowsAppSDK. Waiting for the integration in MAUI to fix the issue.

To check against this sample, in the csproj, replace:

<TargetFrameworks Condition="$([MSBuild]::IsOSPlatform('windows'))">$(TargetFrameworks);net8.0-windows10.0.19041.0</TargetFrameworks>

by

<TargetFrameworks Condition="$([MSBuild]::IsOSPlatform('windows'))">$(TargetFrameworks);net8.0-windows10.0.22621.0</TargetFrameworks>
<TargetPlatformMinVersion>10.0.17763.0</TargetPlatformMinVersion>
<WindowsSdkPackageVersion>10.0.22621.35-preview</WindowsSdkPackageVersion>

And reference the experimental package (if using VS 2022, don't forget to enable Nuget prerelease versions):

<PackageReference Include="Microsoft.WindowsAppSDK" Version="1.6.240531000-experimental1" />

@ITaluone
Copy link

Any chance this fix is included into MAUI before .NET9?

@samhouts samhouts removed s/verified Verified / Reproducible Issue ready for Engineering Triage s/triaged Issue has been reviewed labels Jul 3, 2024
@samhouts samhouts added s/verified Verified / Reproducible Issue ready for Engineering Triage s/triaged Issue has been reviewed labels Jul 10, 2024
@MartyIX
Copy link
Contributor

MartyIX commented Oct 9, 2024

Should be fixed by #24266.

@MartyIX MartyIX closed this as completed Oct 9, 2024
@github-actions github-actions bot locked and limited conversation to collaborators Nov 9, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
area-controls-webview WebView fixed-in-9.0.10 i/regression This issue described a confirmed regression on a currently supported version partner/cat 😻 this is an issue that impacts one of our partners or a customer our advisory team is engaged with platform/windows 🪟 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

No branches or pull requests

10 participants