From cf446be2df707b5c4b25df272bc4eb094ba9ad9c Mon Sep 17 00:00:00 2001 From: Tom Moor Date: Sun, 6 Mar 2022 21:47:30 -0800 Subject: [PATCH] fix: Dragging strings into document can attempt (and file) to insert as attachment --- shared/editor/nodes/Image.tsx | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/shared/editor/nodes/Image.tsx b/shared/editor/nodes/Image.tsx index 034b3a3b7..1c5618fe9 100644 --- a/shared/editor/nodes/Image.tsx +++ b/shared/editor/nodes/Image.tsx @@ -74,7 +74,9 @@ const uploadPlugin = (options: Options) => } // filter to only include image files - const files = getDataTransferFiles(event); + const files = getDataTransferFiles(event).filter( + (dt: any) => dt.kind !== "string" + ); if (files.length === 0) { return false; }