Skip to content

[Problem/Bug]: Find::StartAsync returns a Task which never completes #5159

Open
@pushkin-

Description

@pushkin-

What happened?

StartAsync returns a Task which never completes.
I was expecting that I can await it, and once it completes, I know that the Find popup is visible and focused, but the Task is perpetually in a WaitingForActivation state.

I instead having to do some funky low-level stuff to detect when a window owned by the Form is brought to the front to know when the popup is created.

Importance

Low. My app is not very affected, or this only affects development.

Runtime Channel

Prerelease (Edge Canary/Dev/Beta)

Runtime Version

136.0.3191.0 canary

SDK Version

1.0.3079.0 prerelease

Framework

Winforms

Operating System

Windows 11

OS Version

24H2 - 26100.3194

Repro steps

Disable AreBrowserAcceleratorKeysEnabled and add a KeyDown handler on the webview2 which does:

private async void WebView_KeyDown(object sender, KeyEventArgs e)
{
	    var wv2 = (WebView2)sender;
            if (e.KeyCode == Keys.F && Control.ModifierKeys.HasFlag(Keys.Control))
            {
                e.Handled = true;
                var findOptions = wv2.CoreWebView2.Environment.CreateFindOptions();
                var task = wv2.CoreWebView2.Find.StartAsync(findOptions);
                await task;
                var a = 1;
            }
}

Set a breakpoint on await task and on the statement after it.
Start the app and press Ctrl+F
Notice that we get to the await task; breakpoint, but never beyond it.

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 workingtrackedWe 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