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]: Issue with WebView2CompositionControl .NETFramework4.8 #5098

Open
wdedeveloper opened this issue Feb 12, 2025 · 0 comments
Open
Labels
bug Something isn't working

Comments

@wdedeveloper
Copy link

wdedeveloper commented Feb 12, 2025

What happened?

WebView2CompositionControl component can't be focused, when it is nested under "ScrollViewer". Like this:

<ScrollViewer> <wv2:WebView2CompositionControl /> </ScrollViewer>

Focus of webview control is immediately cancelled and "Focus Lost" event is raised, after click at element within navigated web url (e.g TextBox).
If ScrollViewwer id set with property Focusable="False" like it is below, it is possible select textbox and type into it. But is is not possble to use navigation narrows or other navigation keys (Home, End, PageUp/Dn)
<ScrollViewer Focusable="False"> <wv2:WebView2CompositionControl /> </ScrollViewer>

I do develop an plugin dll into .NET Framework application and don't have an possibility to change/remove the <ScrollViewer>. Because it is part of View, where I need to inject my webview2 component.

Importance

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

Runtime Channel

Stable release (WebView2 Runtime)

Runtime Version

132.0.2957.140

SDK Version

1.0.3065.39

Framework

WPF

Operating System

Windows 11

OS Version

22631.4751

Repro steps

It is reproducible by creating simple project with 2 webview components and do navigate. Upper webview is nested to scrollviewer and the lower one is not.
Clicking on text box in upper webview, and using narrow keys, you will se how focus lost event is fired from webview element. Attached is project I do use for testing. It is copy of situation I do face in production application.
My custom view is injected into main view and main view is nesting region in ScrollViewer. Because of that, I can't change Scrollviewer settings.
Like This:

MainWindow.yaml:
<ScrollViewer> <local:WebViewControlComponent Focusable="True"></local:WebViewControlComponent> </ScrollViewer>
WebViewControlComponent.yaml:
<UserControl> <Grid> <wv2:WebView2CompositionControl Visibility="Visible" MinHeight="100" /> </Grid> </UserControl>

Any help is highly appreciated, I have been waiting for release of this WebView2CompositionControl a while due to not working navigation keys in Webview2 and PanelZ index.

WpfTestdotNetFW.zip

Repros in Edge Browser

No, issue does not reproduce in the corresponding Edge version

Regression

No, this never worked

Last working version (if regression)

No response

@wdedeveloper wdedeveloper added the bug Something isn't working label Feb 12, 2025
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

1 participant