MicrosoftEdge / MicrosoftEdge/WebView2Feedback

Context menu - Separator

Open
#2,370 4 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

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

Description

So I am trying to insert a separator. So far I tried:

CHECK_FAILURE(webviewEnvironment->CreateContextMenuItem(
	L"", nullptr,
	COREWEBVIEW2_CONTEXT_MENU_ITEM_KIND_SEPARATOR,
	&m_separatorContextSubMenuItem));

CHECK_FAILURE(items->InsertValueAtIndex(
	itemsCount, m_separatorContextSubMenuItem.get()));

But I see no separator?

For me personally, could we have a sample that shows us using our own menu template? All the samples seem to "build" a menu. I already have a menu. Although it was designed for IE so thinks like "View Source" will need changing in some way.

But I digress. What is the right way to add a separator to the custom context menu? Eg, just before "New Sub Menu" in the sample code.

AB#39180680

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.

Research direction

Review the WebView2 custom context-menu sample and the CreateContextMenuItem and InsertValueAtIndex calls shown in the issue. Verify how a separator should be inserted into an existing menu, then update the sample or guidance so the separator appears before "New Sub Menu" and the completed behavior is demonstrable.

Written by the indexing model from the issue text.

Assessment

Tech stack
cpp
Domain
desktop
Issue type
Documentation
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
28/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.