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:

ParameterTypeDescription
name"receive-text-menu"Should be 'receive-text-menu'.
callback(menu: Menu, text: string) => voidThe callback function.
ctx?unknownThe 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);
});