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

[Problem/Bug]: WinUI3 AreBrowserAcceleratorKeysEnabled=false has no effect #4241

Closed
Eilon opened this issue Dec 14, 2023 · 9 comments
Closed
Assignees
Labels
bug Something isn't working

Comments

@Eilon
Copy link

Eilon commented Dec 14, 2023

What happened?

Specifically in WinUI3, setting AreBrowserAcceleratorKeysEnabled = false has no effect. Keys such as F5 continue working no matter what, even though they should stop working when the value is set to false.

The same functionality works as expected in WPF.

Importance

Important. My app's user experience is significantly compromised.

Runtime Channel

Stable release (WebView2 Runtime)

Runtime Version

120.0.2210.61

SDK Version

WinAppSDK 1.4.230913002

Framework

WinUI3/WinAppSDK

Operating System

Windows 11

OS Version

22H2 22621.2861

Repro steps

  1. Create new WinUI3 Packaged Desktop app
  2. Change XAML code to just <WebView2 x:Name="WebView2Control" Source="https://www.bing.com" HorizontalAlignment="Stretch" VerticalAlignment="Stretch" />
  3. Change CS code to:
         public MainWindow()
         {
             this.InitializeComponent();
             WebView2Control.CoreWebView2Initialized += WebView2Control_CoreWebView2Initialized;
         }
    
         private void WebView2Control_CoreWebView2Initialized(WebView2 sender, CoreWebView2InitializedEventArgs args)
         {
             sender.CoreWebView2.Settings.AreBrowserAcceleratorKeysEnabled = false;
         }
  4. Run app, and then press F5, Ctrl+P or any other typical browser shortcut

EXPECTED: These keys should be ignored

ACTUAL: The browser responds to these and refreshes/prints/etc.

NOTE: The same code in a WPF WebView2 app works as expected.

Repros in Edge Browser

Not Applicable

Regression

Don't know

Last working version (if regression)

No response

@gameDNA-Helix
Copy link

I can confirm this issue. The same problem with disabling drag & drop.

@tofuandeve
Copy link
Contributor

@gameDNAstudio Hi, we're taking a quick look at this issue, could you provide some more information on the drag and drop scenario? Which API did you use?

@gameDNA-Helix
Copy link

gameDNA-Helix commented Jan 9, 2024

@tofuandeve sometimes when I click too fast on the WebView it starts drag & drop action of nothing (or text probably). Then it leads very often to crash.

I attached screenshot with showing the icon for this action.

Web

web2

@tofuandeve
Copy link
Contributor

tofuandeve commented Jan 9, 2024

@gameDNAstudio got it! And you were able to disable this before or was it always disabled by default and recently it was enabled after updating to later WebView2 runtime? And this dragging action happens when you click within the webview?

@gameDNA-Helix
Copy link

@tofuandeve I didn't use WebView2 before so I don't know how it was before. Yes, I click within the WebView.

@tofuandeve
Copy link
Contributor

@gameDNAstudio after a quick look, the dragging issue seems to be on the WinUI side, we'll get the right folks to take a look at it. For now we'll continue to look at the issue with AreBrowserAcceleratorKeysEnabled setting.

Thanks.

@tofuandeve
Copy link
Contributor

This issue is tracked here #4278 (comment)
This seems to be a regression in WebView2. Please refer to the above thread for future updates.
Thanks!

@victorhuangwq victorhuangwq closed this as not planned Won't fix, can't repro, duplicate, stale Jan 11, 2024
@victorhuangwq
Copy link
Collaborator

Closed issue as duplicate of #4278

@richardhauer
Copy link

According to #4278 this is supposedly fixed in Canary 122 but I have now the beta 122.0.2365 for Edge and the AreBrowserAcceleratorKeysEnabled setting still has no effect in a Blazor hybrid app in MAUI. Is there still an issue with WinUI3 here?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

6 participants
@Eilon @richardhauer @victorhuangwq @gameDNA-Helix @tofuandeve and others