openContextMenu MethodStatic

Show a context menu at a particular location.

openContextMenu(items: CursorMenuItemProps[], location: Readonly<WritableXAndY>, anchorElement?: HTMLElement): boolean

@returns true if the menu was displayed, false if the menu could not be displayed.

Parameter Type Description
items CursorMenuItemProps[] Properties of the menu items to display.
location Readonly<WritableXAndY> Location of the context menu, relative to the origin of anchorElement or the overall window.
anchorElement HTMLElement The HTMLElement that anchors the context menu. If undefined, the location is relative to the overall window.

Returns - boolean

true if the menu was displayed, false if the menu could not be displayed.

Defined in

Last Updated: 21 November, 2024