Open ajtruckle opened 2 years ago
If I comment out all of the sample code and just add a separator it is OK:
CHECK_FAILURE(webviewEnvironment->CreateContextMenuItem(
L"", nullptr,
COREWEBVIEW2_CONTEXT_MENU_ITEM_KIND_SEPARATOR,
&m_separatorContextSubMenuItem));
CHECK_FAILURE(items->InsertValueAtIndex(
itemsCount, m_separatorContextSubMenuItem.get()));
itemsCount++;
But:
m_separatorContextSubMenuItem
. This is overkill as maintaining these items serves us no purpose.itemsCount
is untouched. If we inject items above your sample code then it goes wrong.You can get the updated count and use that value to insert at the end. However, we will look into why you cannot add the same separator object twice. Thanks!
@yildirimcagri I just wanted to add that there is the related issue where all existing separators have the same name value of other
. Ideally they should be distinct so we don't have to manually keep a count.
@yildirimcagri-msft Hi! Any progress with this? Been a couple of years now.
So I am trying to insert a separator. So far I tried:
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