MicrosoftEdge / MicrosoftEdge/WebView2Feedback
Alt menus (mnemonics) do not work properly
Nobody has claimed this yet.
- Dominant language
- PowerShell
- Stars
- 526
- Forks
- 67
- PR merge metrics
- No merged PRs in 30d
Description
We are facing an issue in our application where our menu bar and items are not properly reachable when using alt + mnemonics from inside the webview.
Reproducible code is below:
using System;
using System.Collections.Generic;
using System.Drawing;
using System.Linq;
using System.Threading.Tasks;
using System.Windows.Forms;
using Microsoft.Web.WebView2.WinForms;
namespace WebView2BugMnemonics
{
static class Program
{
/// <summary>
/// The main entry point for the application.
/// </summary>
[STAThread]
static void Main()
{
Application.EnableVisualStyles();
Application.SetCompatibleTextRenderingDefault(false);
Application.Run(CreateTestForm());
}
public static Form CreateTestForm()
{
var form = new Form
{
Size = new Size(1280, 1024)
};
var menuStrip = new MenuStrip
{
Dock = DockStyle.Top
};
var soundMenuItem = new ToolStripMenuItem("Sound", null, new ToolStripMenuItem("Switch on"));
var settingsMenuItem = new ToolStripMenuItem("Settings", null, soundMenuItem);
menuStrip.Items.Add(settingsMenuItem);
var webView2 = new WebView2
{
Dock = DockStyle.Fill,
Source = new Uri(@"about:blank")
};
webView2.CoreWebView2Ready += (sender, e) =>
{
webView2.CoreWebView2.Navigate("https://www.google.com");
};
var textBox = new TextBox
{
Dock = DockStyle.Bottom
};
form.Controls.Add(menuStrip);
form.Controls.Add(webView2);
form.Controls.Add(textBox);
return form;
}
}
}
When you put the focus in the textbox and press Alt + S + S + S/Enter the 'Switch on' menu item will get executed, however when you perform exactly the same actions in the search bar on Google within the webview it does not work as expected. We expect it to work the same as compared to when executing it in the textbox.
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start at CreateTestForm and the WebView2 CoreWebView2Ready handler in the provided reproduction. Compare Alt+mnemonic handling in the TextBox with the Google search bar inside WebView2. Done means the same Alt+S+S+S/Enter sequence reaches and executes the Switch on menu item from both controls.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- csharp
- Domain
- desktop-dev
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100