DataTransferItem

The DataTransferItem object represents one drag data item.

MDN Reference

Properties

Link copied to clipboard

Returns the drag data item kind, one of: "string", "file".

Link copied to clipboard

Returns the drag data item type string.

Functions

Link copied to clipboard
fun getAsFile(): File?

Returns a File object, if the drag data item kind is File.

Link copied to clipboard

Invokes the callback with the string data as the argument, if the drag data item kind is text.