Skip to content

Workspace.on('receive-text-menu') method

Workspace › on(‘receive-text-menu’)

Unofficial

Triggered when user shares text on mobile.

Signature:

on(name: "receive-text-menu", callback: (menu: Menu, text: string) => void, ctx?: unknown): EventRef

Parameters:

Parameter Type Description
name "receive-text-menu" Should be 'receive-text-menu'.
callback (menu: Menu, text: string) => void The callback function.
ctx? unknown The context passed as this to the callback function.

Returns: EventRefThe event reference.

Example:

app.workspace.on('receive-text-menu', (menu, text) => {
console.log(menu, text);
});