This repository was archived by the owner on Jun 18, 2018. It is now read-only.
This repository was archived by the owner on Jun 18, 2018. It is now read-only.
Feature request: Support native folder drop #8
Open
Description
Currently, the native drag source for Files only extracts "files" from the data transfer object. In order to use Chrome's support for folders and folder traversal, it would be nice to have the "items" as well.
I've been able to monkey patch the HTML5Backend to pass along what I need.
function makeFolderAwareHTML5Backend(manager) {
const backend = HTML5Backend(manager);
const orig = backend.handleTopDropCapture;
backend.handleTopDropCapture = function(event) {
backend.currentNativeSource.item.items = event.dataTransfer.items;
return orig(event);
}
return backend;
}
export default DragDropContext(makeFolderAwareHTML5Backend)(DropTarget(types, fileTarget, collect)(App));