Skip to content

Commit

Permalink
阻断默认拖拽事件
Browse files Browse the repository at this point in the history
  • Loading branch information
47479380 committed Aug 10, 2023
1 parent c9494b1 commit 772748e
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 3 deletions.
6 changes: 5 additions & 1 deletion editor/src/init.js
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,11 @@ const chooseFiles = files => {
//拖拽上传
dropElement.addEventListener("dragenter", stopPropagation, false)
dropElement.addEventListener("dragover", stopPropagation, false)
dropElement.addEventListener("drop", e => chooseFiles(e.dataTransfer.files), false)
dropElement.addEventListener("drop", e => {
chooseFiles(e.dataTransfer.files)
stopPropagation(e)
}
, false)

//选择上传
/** @type { HTMLInputElement } */
Expand Down
4 changes: 2 additions & 2 deletions editor/src/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 772748e

Please sign in to comment.