wpfui icon indicating copy to clipboard operation
wpfui copied to clipboard

WebView & WebView2 Do Not Properly Respond to Arrow Key Inputs

Open pinojojo opened this issue 1 year ago • 7 comments

Describe the bug

WebView and WebView2 do not properly respond to arrow key inputs. This problem specifically arises when the WebView is situated within a Page. In contrast, when the WebView is embedded in a ui:FluentWindow (like the gallery app's MonacoWindow), the arrow key inputs are handled correctly.

It seems that there might be a discrepancy in how key input events are managed between different container types. This issue can affect navigation and user interaction within the WebView when it's placed in standard pages.

To Reproduce

Open the gallery application and navigating to the WebView example page, Try to input random texts into the provided text box. use the left or right arrow keys does not alter the cursor position or navigate through the text, indicating that the arrow keys are non-functional in this context. arrowkeyissue

Expected behavior

I would like the webview in typical navigatable Page can respond to arrow Key inputs correctly.

Screenshots

No response

OS version

Windows 11

.NET version

.Net 8.0

WPF-UI NuGet version

3.0.4.0

Additional context

No response

pinojojo avatar Apr 28 '24 08:04 pinojojo

Can confirm, happens to me as well when using WebView2 on a page on an actual UI

SecondNewtonLaw avatar May 07 '24 18:05 SecondNewtonLaw

I took experienced this.

In your page xaml add:

ScrollViewer.CanContentScroll="False"

Though I noticed it breaks my theme when I do that. At least you can use the browser.

joe85 avatar Jun 10 '24 23:06 joe85

Same here, both wpf ui and webview2 on latest release (not prerelease).

SamKr avatar Aug 26 '24 14:08 SamKr