MicrosoftEdge / MicrosoftEdge/WebView2Feedback

[Problem/Bug]: Find:StartAsync clears existing entry on a delay when passing a new FindTerm in

Open
#5,178 2 comments 0 reactions 1 assignee View on GitHub

Nobody has claimed this yet.

bug tracked
Dominant language
PowerShell
Stars
526
Forks
67
PR merge metrics
No merged PRs in 30d

Description

What happened?

If I trigger the Find popup and pass in a starting search term like this:

 var findOptions = wv2.CoreWebView2.Environment.CreateFindOptions();
 findOptions.FindTerm = "a";
 wv2.CoreWebView2.Find.StartAsync(findOptions);

It takes a second or so for the previous search term to be replaced by the new one, so there's a moment where the user can still see the old term.

If you set the FindTerm to be longer (findOptions.FindTerm = "aaaaaaaaaaaaaaaaaaaaaaaaa";), the change becomes near-instantaneous.

Importance

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

Runtime Channel

Prerelease (Edge Canary/Dev/Beta)

Runtime Version

136.0.3216.0 canary

SDK Version

3116.0

Framework

Winforms

Operating System

Windows 11

OS Version

24H2 OS Build 26100.3476

Repro steps
  1. open sample WinForms app
  2. In WebView2Control_CoreWebView2InitializationCompleted, add this.webView2Control.CoreWebView2.Settings.AreBrowserAcceleratorKeysEnabled = false;
  3. In WebView2Control_KeyDown, add this code:
if (e.KeyCode == Keys.F && Control.ModifierKeys.HasFlag(Keys.Control))
{
     e.Handled = true;

         var wv2 = (WebView2)sender;
	var findOptions = wv2.CoreWebView2.Environment.CreateFindOptions();
	findOptions.FindTerm = "a";
	wv2.CoreWebView2.Find.StartAsync(findOptions);

}
  1. Run the app
  2. press ctrl+f
  3. type some text in there
  4. close the popup
  5. press ctrl f
  6. notice the text you typed is still in there and gets replaced with "a" in a second
  7. If you make the FindTerm longer (e.g. "aaaaaaaaaaaaaaaaaaaaaaaaa"), the change happens more quickly
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

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.