From 8853bba4f7e2e831cd1ec31ed3bc51ea33e11c2f Mon Sep 17 00:00:00 2001 From: Pieter Vander Vennet Date: Mon, 15 Jan 2024 01:46:22 +0100 Subject: [PATCH] Fix #1752 --- src/UI/Base/FileSelector.svelte | 21 ++++++++++++++++++++- src/UI/Image/UploadingImageCounter.svelte | 2 +- 2 files changed, 21 insertions(+), 2 deletions(-) diff --git a/src/UI/Base/FileSelector.svelte b/src/UI/Base/FileSelector.svelte index be48e9b2c..a8d423e0c 100644 --- a/src/UI/Base/FileSelector.svelte +++ b/src/UI/Base/FileSelector.svelte @@ -51,11 +51,30 @@ window.removeEventListener("drop", handleDragEvent) }) -
{ + drawAttention = false + dispatcher("submit", inputElement.files) + }} + on:dragend={() => { + console.log("Drag end") + drawAttention = false + }} + on:dragenter|preventDefault|stopPropagation={(e) => { + console.log("Dragging enter") + drawAttention = true + e.dataTransfer.dropEffect = "copy" + }} + on:dragstart={() => { + drawAttention = false + }} + on:drop|preventDefault|stopPropagation={(e) => { + drawAttention = false + dispatcher("submit", e.dataTransfer.files) + }} >