MicrosoftEdge / MicrosoftEdge/WebView2Feedback

WinForms MenuStrip doesn't deactivate and close when clicking inside a web view

Open
#3,288 11 comments 0 reactions 1 assignee View on GitHub

@victorhuangwq is already working on this.

Since Aug 15, 2023.

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

Description

Description
The WinForms MenuStrip doesn't deactivate and close when clicking inside a web view. This could be reproduced in the WinForms sample app while the WPF and Win32 sample apps works as expected.

Version
SDK: 1.0.1587.40
Runtime: Release 110.0.1587.63
Framework: WinForms
OS: Win11

Repro Steps
In the WinForms sample app (WebView2WindowsFormsBrowser):

  • Open a menu
  • Click in the web view

Expected: Web view gets focus and menu deactivates and closes.
Actual: Web view seems to get focus fine but the menu never deactivates and stays open.

Screenshots
winforms-menu

Additional context
Under hit transparent mode (--enable-features=msWebView2BrowserHitTransparent) this does work fine but it's not really an option for us since we need to be able to handle key events in the hosted web app before they reach the host.

I couldn't really tell if this is related or similar to #397 or any of the ones mentioned within.

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.