sindresorhus/electron-context-menu

Omitting default actions if already provided

Open

#70 建立於 2019年5月9日

在 GitHub 查看
 (7 留言) (0 反應) (0 負責人)JavaScript (1,471 star) (167 fork)user submission
enhancementhelp wanted

描述

I'm defining a custom "Copy" action, which does something a bit different than the default "Copy" action, to some buttons, but on right click the content of the button gets selected (and I can't make them unselectable) and so the menu displays 2 "Copy" actions, the one I defined and the one this library defines:

I think I could generate the whole menu manually via the menu option but that would mean detecting all the cases where the default actions should be showed.

Could we instead add an option, canOverrideDefaultActions or something, where before inserting each default action the library check if another action with the same label has been provided already?

貢獻者指南