WebView2Feedback icon indicating copy to clipboard operation
WebView2Feedback copied to clipboard

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

Open pushkin- opened this issue 8 months ago • 2 comments

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

pushkin- avatar Mar 25 '25 15:03 pushkin-

can you check if you still see this issue in the runtime >=143.0.3624.0

Navdeep-ss avatar Oct 22 '25 08:10 Navdeep-ss

still an issue

pushkin- avatar Oct 22 '25 16:10 pushkin-