@uppy/utils
Version:
Shared utility functions for Uppy Core and plugins maintained by the Uppy team.
16 lines • 406 B
JavaScript
/**
* Checks if the browser supports Drag & Drop (not supported on mobile devices, for example).
*/
export default function isDragDropSupported() {
const div = document.body;
if (!('draggable' in div) || !('ondragstart' in div && 'ondrop' in div)) {
return false;
}
if (!('FormData' in window)) {
return false;
}
if (!('FileReader' in window)) {
return false;
}
return true;
}