Context Menus
quip.apps.showContextMenu
This method displays a context menu to the user with the given set of commandIds
. It should only be called in response to a user event, usually a right-click on an element.
event
required
MouseEvent
We use this event to determine where to show the context menu, so it should have standard mouseEvent properties like clientX
and clientY
.
commandIds
required
string[]
A list of the commandIds
(as previously defined in a call to updateToolbar
or during initialization
highlightedCommandIds
optional
string[]
A list of commandIds
that will be shown as highlighted in this context menu.
disabledCommandIds
optional
string[]
A list of commandIds
that will be shown as disabled in this context menu.
onDismiss
optional
Function() => void
This function will be called when the context menu is dismissed, either due to the user selecting a command or clicking away.
contextArg
optional
{[key: string]: any}
You may define any metadata you like in this argument and it will be forwarded to the command when invoked via this menu. See the MenuCommand handler documentation for usage.