microsoft / WindowsAppSDK

The Windows App SDK empowers all Windows desktop apps with modern Windows UI, APIs, and platform features, including back-compat support, shipped via NuGet.
https://docs.microsoft.com/windows/apps/windows-app-sdk/
MIT License
3.72k stars 307 forks source link

WebView2 not handling DOM events properly #4477

Closed Foda closed 2 weeks ago

Foda commented 3 weeks ago

Describe the bug

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

Copied from https://github.com/dotnet/maui/issues/22697 as this issue is affecting customers of MAUI.

Note: this does NOT happen in the WPF/WinForms version of Webview2 -- it is an issue specifically w/ WinAppSDK

Steps to reproduce the bug

  1. Just create a new app and add the following XAML: <WebView2 x:Name="webView" Source="https://google.com"/>

  2. Click on the app selector icon.

  3. Click on any link to be redirected to any Google app.

  4. The menu closes and the navigation is not done.

image image

Expected behavior

The navigation to the selected Google app should have been done.

Screenshots

No response

NuGet package version

Windows App SDK 1.5.3: 1.5.240428000

Packaging type

Packaged (MSIX), Unpackaged

Windows version

Windows 11 version 22H2 (22621, 2022 Update)

IDE

Visual Studio 2022-preview, Visual Studio 2022, Visual Studio 2019

Additional context

https://github.com/MicrosoftEdge/WebView2Feedback/issues/4598

codendone commented 2 weeks ago

Closing as duplicate of microsoft/microsoft-ui-xaml#9566, which has a fix in Version 1.5.4 (1.5.240607001).