@mocanvas/mocanvas · function

startEditingShapeWithRichText

declare function startEditingShapeWithRichText(editor: ReturnType<typeof useEditor>, shapeOrId: ShapeId | {
    id: ShapeId;
}, options?: {
    selectAll?: boolean;
}): void

Put a shape into text-editing mode from outside the label.

The path a tool or a menu item takes: creating a note and dropping the caret into it, or "Edit text" in the context menu. Selecting the shape first is deliberate — editing a shape that is not selected leaves the selection UI pointing somewhere else.

mocanvas is built by Symbio. Free for non-commercial, non-profit and development use; commercial use needs an agreement. Not affiliated with or endorsed by tldraw.