HTML
Helpers to make working with native HTML data easiercontainsHTML
Useful to know whether text data ("text/html") is being dragged. Keep in mind that multiple pieces
of native data can be dragged at once.
import { containsHTML } from '@atlaskit/pragmatic-drag-and-drop/external/html';
dropTargetForExternal({
element: myElement,
canDrop: containsHTML,
});
monitorForExternal({
canMonitor: containsHTML,
});getHTML
A helper to extract text data ("text/html") from drop data. Get text will return null when there
is no html data.
import { getHTML } from '@atlaskit/pragmatic-drag-and-drop/external/html';
dropTargetForExternal({
element: myElement,
onDrop({ source }) {
const html: string | null = getHTML({ source });
},
});
monitorForExternal({
onDrop({ source }) {
const html: string | null = getHTML({ source });
},
});