You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Jason Godesky edited this page Jul 16, 2026
·
3 revisions
getDroppedDocument is a method that will take the drop event from a DragDrop instance and return the document that was dropped.
Parameters
event: DragEvent
The drop event.
type?: string
A filter that requires that the document match the given type (e.g., 'Actor', 'Item', 'JournalEntry', etc.).
subtype?: string
A filter that requires that the document match the given subtype (the type property on the document).
Returns
A Promise of the document dropped if it (a) can be found and (b) matches the type and subtype provided, or null otherwise.
Examples
import{getDroppedDocument}from'@revolutionarygamesco/common-foundryvtt'const{ ApplicationV2, HandlebarsApplicationMixin }=foundry.applications.apiexportclassMyApplicationextendsHandlebarsApplicationMixin(ApplicationV2){character?: foundry.documents.Actor// Lots of other stuff to get this set up...async_onDrop(event: DragEvent){constcharacter=awaitgetDroppedDocument<foundry.documents.Actor>(event,'Actor','character')if(!character)returnthis.character=character}}