From f908bd4a645306c89c5f90be41dbc7d5273fc308 Mon Sep 17 00:00:00 2001 From: Ethan Margaillan Date: Wed, 20 Mar 2024 05:28:13 +0100 Subject: [PATCH] fix(web): prevent drag-n-drop upload overlay from showing when not dragging files (#8082) --- .../shared-components/drag-and-drop-upload-overlay.svelte | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/web/src/lib/components/shared-components/drag-and-drop-upload-overlay.svelte b/web/src/lib/components/shared-components/drag-and-drop-upload-overlay.svelte index c4ecb5fb12..234448d66d 100644 --- a/web/src/lib/components/shared-components/drag-and-drop-upload-overlay.svelte +++ b/web/src/lib/components/shared-components/drag-and-drop-upload-overlay.svelte @@ -6,7 +6,9 @@ let dragStartTarget: EventTarget | null = null; const handleDragEnter = (e: DragEvent) => { - dragStartTarget = e.target; + if (e.dataTransfer && e.dataTransfer.types.includes('Files')) { + dragStartTarget = e.target; + } };