mirror of
https://github.com/AUTOMATIC1111/stable-diffusion-webui.git
synced 2026-01-10 11:11:26 -08:00
Fix dragging text to prompt
This commit is contained in:
parent
89f9faa633
commit
a862428902
2 changed files with 3 additions and 3 deletions
4
javascript/dragdrop.js
vendored
4
javascript/dragdrop.js
vendored
|
|
@ -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"]');
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue