aboutsummaryrefslogtreecommitdiffstats
path: root/javascript/dragdrop.js
diff options
context:
space:
mode:
authorAUTOMATIC1111 <16777216c@gmail.com>2023-05-22 04:15:44 +0000
committerGitHub <noreply@github.com>2023-05-22 04:15:44 +0000
commitee2f4fb92da56ce5d5d06a78332e7f7da56ee2ae (patch)
treec5a02e9f9ae57c9f0ff8499379c6cc61a97c094e /javascript/dragdrop.js
parent3366e494a1147e570d8527eea19da88edb3a1e0c (diff)
parent8137bdba61fd57cc1ddae801f6080d51e13d70c5 (diff)
downloadstable-diffusion-webui-gfx803-ee2f4fb92da56ce5d5d06a78332e7f7da56ee2ae.tar.gz
stable-diffusion-webui-gfx803-ee2f4fb92da56ce5d5d06a78332e7f7da56ee2ae.tar.bz2
stable-diffusion-webui-gfx803-ee2f4fb92da56ce5d5d06a78332e7f7da56ee2ae.zip
Merge pull request #10615 from missionfloyd/text-drag-fix
Fix dragging text to prompt
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"]');