MicrosoftEdge / MicrosoftEdge/WebView2Feedback

[Feature]: Provide a public API to programmatically close the default find/search bar in Webview2

Open
#5,377 4 comments 0 reactions 1 assignee View on GitHub

@Navdeep-ss is already working on this.

Since Nov 27, 2025.

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

Description

Describe the feature/enhancement you need

Product:
Microsoft.Web.WebView2 (WPF/.NET 8)
Description:
When using the default find/search bar in WebView2, there is no supported way to programmatically close or hide the bar.
• The CoreWebView2 API does not expose a method like StopFind or CloseFindBar.
• Sending synthetic ESC key events (via SendInput, SendMessage, or similar Win32 APIs) does not close the find bar, even when the WebView2 control has focus.
• Only a real, physical ESC key press by the user closes the bar.
Expected Behavior:
There should be a public API to programmatically close the default find/search bar, or synthetic input should be processed the same as real user input.

Actual Behavior:
• No API exists to close the find bar.
• Synthetic ESC key events are ignored by the Chromium input pipeline.
• The only workaround is to suppress the default find UI and implement a custom one, which is not always desirable.

Steps to Reproduce:

  1. Open a WebView2 control in a WPF app.
  2. Show the default find/search bar (Ctrl+F).
  3. Attempt to close it programmatically using SendInput or SendMessage with ESC.
  4. Observe that the bar remains open.
    Workarounds Tried:
    • SendInput and SendMessage with ESC key.
    • Focusing the WebView2 control before sending input.
    • Searching for any public API to close the find bar.
The scenario/use case where you would use this feature

There are some use-case in my application where search bar is opened in one page. Then user is navigating to another page where serchbar is not expected to be visible. This is a customer complaint.

How important is this request to you?

----Please select----

Suggested implementation

Request:
Please provide a public API to programmatically close the default find/search bar, or document a supported way to do so.
Environment:
• WebView2 SDK: [your version]
• .NET: 8.0
• OS: [your OS version]
• WPF

What does your app do? Is there a pending deadline for this request?

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.