Type Editor / @type-editor/menu / menubar/render-grouped / renderGrouped
Function: renderGrouped()
ts
function renderGrouped(
view,
content,
showLabel?,
isLegacy?,
): {
dom: DocumentFragment;
menuItems: HTMLElement[];
update: (state) => boolean;
};Defined in: packages/menu/src/menubar/render-grouped.ts:21
Render the given, possibly nested, array of menu elements into a document fragment, placing separators between them (and ensuring no superfluous separators appear when some of the groups turn out to be empty).
Parameters
| Parameter | Type | Default value | Description |
|---|---|---|---|
view | PmEditorView | undefined | The editor view instance |
content | readonly readonly MenuElement[][] | undefined | A nested array of menu element groups to render |
showLabel | boolean | false | Whether to show labels for menu items (if applicable, e.g. in DropdownMenu) |
isLegacy | boolean | false | Backward compatibility mode |
Returns
ts
{
dom: DocumentFragment;
menuItems: HTMLElement[];
update: (state) => boolean;
}An object containing the document fragment and an update function
| Name | Type | Default value | Defined in |
|---|---|---|---|
dom | DocumentFragment | result | packages/menu/src/menubar/render-grouped.ts:117 |
menuItems | HTMLElement[] | - | packages/menu/src/menubar/render-grouped.ts:119 |
update() | (state) => boolean | - | packages/menu/src/menubar/render-grouped.ts:118 |