dotnet / maui

.NET MAUI is the .NET Multi-platform App UI, a framework for building native device applications spanning mobile, tablet, and desktop.
https://dot.net/maui
MIT License
21.87k stars 1.68k forks source link

[Windows] WebView2 not handling DOM events properly #22697

Open sreiss opened 1 month ago

sreiss commented 1 month ago

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

github-actions[bot] commented 1 month ago

Hi I'm an AI powered bot that finds similar issues based off the issue title.

Please view the issues below to see if they solve your problem, and if the issue describes your problem please consider closing this one and thumbs upping the other issue to help us prioritize it. Thank you!

Closed similar issues: