Skip to content

UWP Touch keyboard not working in Webview 2 after Task.delay #2811

@Dennie-van-Dijk

Description

@Dennie-van-Dijk

Description
If task.delay is used before creating a WebView2 component the touch keyboard will not be displayed.

Version
SDK: 1.0.1369-prerelease and 1.0.1343.22
Runtime: Release 105.0.1343.42
Framework: UWP C#
OS: Win11 21H2 22000.194 and Win10 21H2 19044.1889

Repro Steps
Create a UWP project with WebView2

Add to the MainPage class the following code:

public MainPage()
{
	this.InitializeComponent();
	Wait();
}

private async void Wait()
{
	Grid grid = new Grid();
	Content = grid;
	webView1 = new WebView2
	{
		Source = new Uri("https://www.bing.com"),
		HorizontalAlignment = HorizontalAlignment.Left,
		Width = 400
	};
	grid.Children.Add(webView1);
	await Task.Delay(10000);
	webView2 = new WebView2
	{
		Source = new Uri("https://www.bing.com"),
		Margin = new Thickness(400, 0, 0, 0)
	};
	grid.Children.Add(webView2);
}

The touch keyboard is not displayed when focusing the input field of the right WebView2 window.
The left WebView2 window is working correctly.

The touch keyboard must be visible for both windows.

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