Spell check suggestion text is not available in ContextMenuRequested event
Description
CoreWebView2ContextMenuRequestedEventArgs.MenuItems for CoreWebView2.ContextMenuRequested event contain list of commands with spellcheck name but there's no way to get the actual suggestion text.
Version SDK: 1.0.1189-prerelease Runtime: 100.0.1185.29 Framework: WPF OS: Win11
Repro Steps
- Add event handler to
CoreWebView2.ContextMenuRequested - Start the application
- Right click on a misspelled word
- There are
spellcheckcommands inCoreWebView2ContextMenuRequestedEventArgs.MenuItemsbut there's no suggestions available for any of them. Setting theirCommandIdasSelectedCommandIdworks properly as the misspelled word will be corrected.
Screenshots

Additional context Without this information it's not possible for us to build a custom context menu with spell check suggestions.
Thanks for the bug report @q71114 - I've added this to our backlog.
I am also facing same issue in release build 1.0.1185.39
Description
The problem still active on 1.0.1245.22 build.
And added to this bug, I do not open a new because I think this is a same issue. The simple fact of use Console.WriteLine to get feedback causes that suggestions never shown. For example:
for (int i = 0; i < e.MenuItems.Count; i++)
{
Console.WriteLine($"{e.MenuItems[i].Name} -- {e.MenuItems[i].CommandId}");
if (!acceptedCommandIds.Contains(e.MenuItems[i].CommandId))
{
e.MenuItems.RemoveAt(i);
i -= 1;
}
}
And now a curious behavior. If I remove Console.WriteLine, the first time that the context menu it's open, suggestions are not shown and message “getting suggestions” stay freeze, but then, on the following calls, all works fine and suggestions are shown. Even if in the first time the open menu has another kind (Page for example), the next times spell suggestions will work fine… Maybe some missing initialization?
Version Runtime: 1.0.1245.22 Framework: NET 6.0 - WinForms OS: Win10 x64
@carlosbet , your "curious behaviour" sounds like it could be #3142
When right clicking for the context menu on the misspelled word text, what are you seeing? Are there blank strings in the menu items or is there the placeholder (i.e. "Getting suggestions")?
@srwei Following @q71114 's repro steps, we're seeing blank labels in the CoreWebView2ContextMenuRequestedEventArgs.MenuItems:
+++> Caught CoreWebView2ContextMenuRequestedEventArgs with menu items:
+++> label: '', name: 'spellcheck', kind: 'Command'
+++> label: '', name: 'spellcheck', kind: 'Command'
+++> label: '', name: 'spellcheck', kind: 'Command'
+++> label: '', name: 'other', kind: 'Separator'
+++> label: 'Cu&t', name: 'cut', kind: 'Command'
+++> label: '&Copy', name: 'copy', kind: 'Command'
+++> label: '&Paste', name: 'paste', kind: 'Command'
+++> label: 'P&aste as plain text', name: 'pasteAndMatchStyle', kind: 'Command'
+++> label: '&Share', name: 'share', kind: 'Command'
+++> label: '&Web capture', name: 'webCapture', kind: 'Command'
+++> label: '', name: 'other', kind: 'Separator'
+++> label: 'I&nspect', name: 'inspectElement', kind: 'Command'
Note that this is repro'd by handling CoreWebView2.ContextMenuRequested event, as per the original bug report.
When can we expect this issue to be resolved? Without it we cannot fully integrate WebView2 in our application and this bug has been open for more than a year already...
Has there been any news on this @champnic and @srwei? Spell checking still is a major issue and it seems like multiple users here are reporting these things, is a review of the spell checking API in the works?
I also would like to know the current state of this issue. @srwei
The spell checking APIs are currently completely broken. Because of this bug a custom context menu cannot be used (since you're left with blank labels so the spelling options cannot be displayed for users), but even if you attempt to use a non-custom context menu, because of issue 3142 the spelling suggestions just never appear. cc @nishitha-burman @liminzhu
Hello,
A fix has been checked into Canary 123+. Can you please check if this issue is resolved for you?
Thanks!
Hi @nishitha-burman,
Thanks for letting us know, unfortunately it still doesn't seem to work.
Here is the test I conducted using Scenario > Custom Context Menu in WebView2Samples.
You can see that the spell check suggestions are still blank:
Hello,
Can you please try with Runtime version 123.0.2377.0?
Thanks!
Also note that if you switch to customized context menu live. You gonna need to refresh once to resolve the blank issue
@nishitha-burman Using 123.0.2377.0 https://github.com/MicrosoftEdge/WebView2Feedback/issues/3142 is solved now
but this issue with the customized context menu is still not fixed:
Also note that if you switch to customized context menu live. You gonna need to refresh once to resolve the blank issue
Hi @dianaqu, thanks for your suggestion. I tried to click on Reload after switching to customized context menu but that didn't work.
Do you mind elaborating on this please? What did you mean by You gonna need to refresh once?
Hi @q71114 I did some quick debugging this morning and we found a bug on using customized context menu on the fly, the related object will not be initialized. But a workaround is to start up Webview2 with enabled customized context menu and set up handlers. That way, spellcheck will work as expected, Thanks @nishitha-burman for verify that route!
Unfortunately custom context menu items still do not have the spellcheck text available, I don't exactly know what you mean by your latest suggestion @dianaqu but can we expect a fix soon?
I'm also especially interested as the 1.0.2277.86 SDK update mentions "Ensured that the spellcheck language matches put_Language programmatically. The customized context menu is also updated with correct spellchecks. (Runtime-only)" which seems to be this issue, so it will be fixed in Stable 121.0.2277.86+ as well?
a workaround is to start up Webview2 with enabled customized context menu and set up handlers
@dianaqu, I'm so sorry, but it's still not clear to me what is the workaround here. Do you mind sharing a code sample that I can try out?
@nishitha-burman Do you mind sharing what you tried to get it working?
Was there some breaking change around this recently? I'm using WebView2 under UWP with recent dev channel and the entire spell checking functionality is now completely missing. It wasn't working properly in the first place (had to resort to my own spell checker to fill in the blanks in the context menu, using a custom context menu), but now it's completely missing, no red line under misspelled text, no relevant option in the context menu.
@nirbil yes and no. We have shipped couple fixes to ensure spellcheck works for different languages. And we noticed a bug that without using put_Language to set language to en-US, spellcheck will get disabled. The current workaround is to set language. I'm working on fixing the issue.
@nirbil yes and no. We have shipped couple fixes to ensure spellcheck works for different languages. And we noticed a bug that without using put_Language to set language to en-US, spellcheck will get disabled. The current workaround is to set language. I'm working on fixing the issue.
I ensured that the default language is set to 'en-US' in the app manifest. I suspect something was broken along the way at least on UWP as the spell check is now disabled and it used to (somewhat) work. Should I open a new bug?
What version of WebView2 runtime are you using? And what channel?
Latest version - 1.0.2277.86. Checked it in both dev and standard channels.
121.0.2277.112 have all fixes we cherry pick. Could you update and try that?
That's the current stable release channel version. I checked it, spell checking doesn't work.
@nishitha-burman Do you mind sharing what you tried to get it working?
@dianaqu @nishitha-burman Is there any update on this? I'd love to try out the aforementioned workaround if you could share it with me.
@q71114 In the Sample app code I set m_allowCustomMenus to true (it is false by default). You can find this in SettingsComponent.h. And now am seeing spellcheck suggestions. Does this work for you?
m_allowCustomMenus
@nishitha-burman Thanks for that. I only ever tried the WPF integration sample app (WebView2WpfBrowser) because that one resembles more to what we try to achieve and I couldn't find something similar to what you wrote. Does that mean at the moment this feature (spell check suggestion using custom menu) won't work with the WPF integration?
Was there some breaking change around this recently? I'm using WebView2 under UWP with recent dev channel and the entire spell checking functionality is now completely missing. It wasn't working properly in the first place (had to resort to my own spell checker to fill in the blanks in the context menu, using a custom context menu), but now it's completely missing, no red line under misspelled text, no relevant option in the context menu.
Should I start a separate regression bug for WinUI2/UWP?