Open noseratio opened 3 years ago
TBH, at this stage I feel like the best path for hosting WebView2
is to implement a custom wrapper on top of CoreWebView2
and CoreWebView2Controller
.
That would give me direct access to important VW2 integration APIs like AcceleratorKeyPressed
, GotFocus
, LostFocus
, MoveFocusRequested
etc.
Hey @noseratio - thanks for the bug reports! I believe these are mostly tracked in other issues, but I've added this to our scenario we have for tracking keyboarding issues and improving the experience here. We know this is currently a bad pain-point for devs using our .NET controls and have this as a high-priority scenario on our backlog. Thanks!
Hi @champnic, thanks for putting it on track. FWIW, the current keyboard/focus behavior is a lot better than that of BlazorWebView
, at least in its current iteration where it's practically unusable: https://github.com/dotnet/maui/issues/2341.
I keep saying it... I believe would be beneficial for both Microsoft and the WebView2 dev community if (at least) the .NET wrappers for WebView2
were made open-source.
Some folks, me included, have been dealing with browser control integration issues since the early days of IE ActiveX-based WebBrowser
wrappers in .NET. We might help fixing a bug or adding a feature. For example, BlazorWebView
again, like this kind of things.
Hi, @noseratio! We have released a new feature in the recent release(109). Focus and Inputs will be on native apps in this mode. You can enable this mode by enabling the feature flag ("--enable-features=msWebView2BrowserHitTransparent") in CoreWebView2CreationProperties.AdditionalBrowserArguments or CoreWebView2EnvironmentOptions.AdditionalBrowserArguments. I think enabling this feature will make Alt+X work(still some work to make Alt+Space work). Because this is a big change, there may be new bugs in this new feature. Please notify us if you find new issue related to the new feature.
@zhuhaichao518 thank you - well done, good to see some progress! I'll give this new feature a try and will report what I'll find.
What is the current state of this? It appears that there is still no official documentation about this feature. It isn't even listed in here.
We now have a ControllerOptions API for enabling this, instead of the feature flag: https://learn.microsoft.com/en-us/dotnet/api/microsoft.web.webview2.core.corewebview2controlleroptions.allowhostinputprocessing?view=webview2-dotnet-1.0.2730-prerelease
Description
I've tried the latest
WebView2
(SDK v1.0.955-prerelease, runtime v92.0.902.84) with Windows Forms on .NET v6.0.100-preview.7. I'm seeing a lot of improvements, but I still could spot the following issues:WebView2
. OTOH, Alt+F4 does work as expected, I believe it didn't in early releases 👍.WebView2
. They do when the focus is inside a native control likeTextBox
. Related WPF issue: https://github.com/MicrosoftEdge/WebView2Feedback/issues/468.WebView2
activates WinForms menu, but the focus remains insideWebView2
:Version
WebView2
SDK v1.0.955-prereleaseWebView2
runtime v92.0.902.84 .NET v6.0.100-preview.7 Windows 10 v19043.1165Repro Steps
https://github.com/noseratio/WebView2WinFormsSysHotKeys .
dotnet run
AB#34280866