浏览代码

fix error in dragdrop logic

AUTOMATIC 2 年之前
父节点
当前提交
cc2f6e3b7b
共有 1 个文件被更改,包括 2 次插入2 次删除
  1. 2 2
      javascript/dragdrop.js

+ 2 - 2
javascript/dragdrop.js

@@ -57,8 +57,8 @@ function eventHasFiles(e) {
 }
 
 function dragDropTargetIsPrompt(target) {
-    if (!(target?.placeholder?.indexOf("Prompt") >= 0)) return true;
-    if (target?.parentNode?.parentNode) return true;
+    if (target?.placeholder && target?.placeholder.indexOf("Prompt") >= 0) return true;
+    if (target?.parentNode?.parentNode?.className?.indexOf("prompt") > 0) return true;
     return false;
 }