Fixes to document drag&drop

This commit is contained in:
Jori Lallo
2017-10-23 23:12:28 -07:00
parent d82bcd3dcc
commit a5c1b64900
2 changed files with 57 additions and 99 deletions

View File

@ -83,6 +83,7 @@ type KeyData = {
};
handleDrop = async (ev: SyntheticEvent) => {
if (this.props.readOnly) return;
// check if this event was already handled by the Editor
if (ev.isDefaultPrevented()) return;
@ -92,7 +93,9 @@ type KeyData = {
const files = getDataTransferFiles(ev);
for (const file of files) {
await this.insertImageFile(file);
if (file.type.startsWith('image/')) {
await this.insertImageFile(file);
}
}
};