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) + }} >