Search Docs
Loading...
Skip to content

Type Alias: AssetDropAction

type AssetDropAction = (payload) => void | Promise<void>;

Action function for an asset dropped on the canvas.

The default implementation replaces the content of target with the asset, or adds the asset to page centered on the drop point. For a drag from the Replace panel it only replaces, so a drop without a target adds nothing. Register a custom implementation to change what a drop does, for example to handle assets from your own drag source.

Parameters#

Parameter Type Description
payload AddImageOptions Where the asset was released

Returns#

void | Promise<void>

A promise that resolves when the drop is handled, or void for synchronous operations