From 0c91e897be5377a6fda883a02a7d3be45be5b230 Mon Sep 17 00:00:00 2001 From: Laila Los <44241786+ElectronicBlueberry@users.noreply.github.com> Date: Wed, 2 Nov 2022 15:54:06 +0100 Subject: [PATCH] fix drop cancellation --- client/src/composables/useFileDrop.js | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/client/src/composables/useFileDrop.js b/client/src/composables/useFileDrop.js index 3c8b6394d2d..76e8ed1609f 100644 --- a/client/src/composables/useFileDrop.js +++ b/client/src/composables/useFileDrop.js @@ -39,13 +39,15 @@ export function useFileDrop(dropZone, onDrop, solo) { document.body, "drop", (event) => { - if (!dragBlocked.value && isFileOverDocument.value) { + if (!dragBlocked.value) { // prevent the browser from opening the file event.preventDefault(); - isFileOverDocument.value = false; - unref(onDrop)(event); + if (isFileOverDropZone.value && isFileOverDocument.value) { + unref(onDrop)(event); + } } + isFileOverDocument.value = false; dragBlocked.value = false; }, true