ContextMenuSettings
23 Sep 20251 minute to read
Represents ContextMenuSettings in the block editor component.
Properties
enable boolean
Specifies whether the context menu is enabled.
If set to false, the context menu will not be displayed.
Defaults to true
itemTemplate string|Function
Specifies a custom template for menu items.
Accepts either a string template or a function returning a custom template.
Defaults to null
items ContextMenuItemModel[]
Specifies the list of context menu items.
Defaults to []
showItemOnClick boolean
Specifies whether menu items should only be shown when clicked.
If set to true, submenu items appear only when the parent item is clicked.
Defaults to false
Events
beforeClose EmitType<ContextMenuBeforeCloseEventArgs>
Triggers before the context menu closes.
beforeOpen EmitType<ContextMenuBeforeOpenEventArgs>
Triggers before the context menu opens.
close EmitType<ContextMenuCloseEventArgs>
Triggers when the context menu is closed.
itemClick EmitType<ContextMenuItemClickEventArgs>
Triggers when an item in the context menu is being clicked.
This event provides details about the clicked menu item.
open EmitType<ContextMenuOpenEventArgs>
Triggers when the context menu is opened.