Skip to content

[Problem/Bug]: Find filter don't persist when using Find APIs #5390

@pushkin-

Description

@pushkin-

What happened?

This works fine when enabling accelerator keys and allowing the native Find behavior.

But when I disable AreBrowserAcceleratorKeysEnabled and intercept Ctrl+F and call StartAsyncmyself, after setting some filters, closing and reopening the Find popup twice, the filter selection is cleared.

Importance

Moderate. My app's user experience is affected, but still usable.

Runtime Channel

Stable release (WebView2 Runtime), Prerelease (Edge Canary/Dev/Beta)

Runtime Version

143.0.3603 canary

SDK Version

3530.0

Framework

Winforms

Operating System

Windows 11

OS Version

26100.6584

Repro steps

Download minimal WinForms sample. In BrowserForm.cs::WebView2Control_CoreWebView2InitializationCompleted, add in: this.webView2Control.CoreWebView2.Settings.AreBrowserAcceleratorKeysEnabled = false;

Replace WebView2Control_KeyDown with:

    private void WebView2Control_KeyDown(object sender, KeyEventArgs e)
    {
            var find = this.webView2Control.CoreWebView2.Find;
            if (e.KeyCode == Keys.F)
            {
                var options = webView2Control.CoreWebView2.Environment.CreateFindOptions();
                options.FindTerm = "";
                find.StartAsync(options);
            }
   }

  1. press Ctrl+F
  2. search something
  3. change the filter (e.g. match case)
  4. close and reopen the Find popup
  5. notice filter is still set
  6. close and reopen the Find popup
  7. notice the filter selections are cleared

Image

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