Skip to content

[Problem/Bug]: WebView2CompositionControl in ScrollViewer doesn't respond to the keyboard #5057

Open
@simon1689

Description

@simon1689

What happened?

We've been having issues with the airspace problem for a couple of years now and we're happy seeing it being resolved. In testing, I came across something very annoying.

We have a framework of our own which we use for every View we have in our application. In this templated View, we have a ScrollViewer. A couple of weeks ago I came across a solution for the problem of the navigation keys (left, right, up, down, PgUp, PgDown) not getting through to WebView2. So I decided to test the same scenario with the Composition Control and found out that the control does not respond at all to the keys. Apprently there is a focus problem.

Importance

Blocking. My app's basic functions are not working due to this issue.

Runtime Channel

Stable release (WebView2 Runtime)

Runtime Version

132.0.2957.127

SDK Version

1.0.2957.106

Framework

WPF

Operating System

Windows 10

OS Version

No response

Repro steps

I made a test app with the following code:

<Window x:Class="WebView2_netcore.CompositionControlWithScrollViewer"
        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:WebView2_netcore"
        mc:Ignorable="d"
        xmlns:wv2="clr-namespace:Microsoft.Web.WebView2.Wpf;assembly=Microsoft.Web.WebView2.Wpf"
        Title="Composition Control With ScrollViewer" 
        Height="800" 
        Width="1000">
    <Grid>
        <ScrollViewer>
            <wv2:WebView2CompositionControl Name="google" Source="https://www.google.com" />
        </ScrollViewer>
    </Grid>
</Window>

When the app starts, I try to typ something in Google, but nothing happens in the text box. This is a huge problem, that hopefully can be fixed so that we could go on using WebView2 without the airspace problems.

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

Metadata

Metadata

Assignees

Labels

bugSomething isn't working

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions