aboutsummaryrefslogtreecommitdiff
path: root/javascript/dragdrop.js
diff options
context:
space:
mode:
Diffstat (limited to 'javascript/dragdrop.js')
-rw-r--r--javascript/dragdrop.js4
1 files changed, 2 insertions, 2 deletions
diff --git a/javascript/dragdrop.js b/javascript/dragdrop.js
index 77a24a07..fd6b3154 100644
--- a/javascript/dragdrop.js
+++ b/javascript/dragdrop.js
@@ -51,7 +51,7 @@ function dropReplaceImage(imgWrap, files) {
window.document.addEventListener('dragover', e => {
const target = e.composedPath()[0];
const imgWrap = target.closest('[data-testid="image"]');
- if (!imgWrap && target.placeholder && target.placeholder.indexOf("Prompt") == -1) {
+ if (e.dataTransfer.files.length == 0 || (!imgWrap && target.placeholder && target.placeholder.indexOf("Prompt") == -1)) {
return;
}
e.stopPropagation();
@@ -61,7 +61,7 @@ window.document.addEventListener('dragover', e => {
window.document.addEventListener('drop', e => {
const target = e.composedPath()[0];
- if (target.placeholder.indexOf("Prompt") == -1) {
+ if (e.dataTransfer.files.length == 0 || target.placeholder.indexOf("Prompt") == -1) {
return;
}
const imgWrap = target.closest('[data-testid="image"]');