Skip to content

WebView2 in WPF ScrollViewer causes arrow, home, end keys to not work in INPUT elements #2052

@GCymbala

Description

@GCymbala

Description
When a WebView2 control is contained within a <ScrollViewer> control, input text boxes displayed in the WebView2 no longer respond correctly to arrow, Home and End keys

Version
SDK: Mircorosft.Web.WebView2 1.0.1054.31
Runtime: Microsoft Edge WebView2 Runtime 96.0.1054.62
Framework: WPF
.NET Framework: 4.7.2
OS: Win10

Repro Steps
Create a WPF Windows App with one window containing a DockPanel, ScrollViewer, and WebView2:

<Window x:Class="WpfAppBrowser.MainWindow"
        xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
        xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
        xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
        xmlns:local="clr-namespace:WpfAppBrowser"
        xmlns:wv2="clr-namespace:Microsoft.Web.WebView2.Wpf;assembly=Microsoft.Web.WebView2.Wpf"
        mc:Ignorable="d"
        Title="MainWindow"
        Height="450"
        Width="800"
>
    <DockPanel>
        <ScrollViewer VerticalScrollBarVisibility="Auto" HorizontalScrollBarVisibility="Auto">
            <wv2:WebView2 Name="webView"
                  Source="https://www.bing.com"
            />
        </ScrollViewer>
    </DockPanel>
</Window>

Once bing.com has loaded, enter some text in the Bing search text input field.
Try to move the cursor within the text input using left, right arrow keys, and Home and End keys.
Expected behavior: Text input cursor moves according to the keys pressed.
Actual behavior: The cursor does not move. It remains at the end of the text.

AB#37648000

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingpriority-lowWe have considered this issue and decided that we will not be able to address it in the near future.trackedWe are tracking this work internally.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions