fix: paste elements boundary error

This commit is contained in:
Hufe921
2024-04-27 22:41:53 +08:00
parent ed9cb53ad8
commit 34d59bbb58
2 changed files with 25 additions and 7 deletions
+12
View File
@@ -79,3 +79,15 @@ export function writeElementList(
if (!text && !html && !elementList.length) return
writeClipboardItem(text, html, zipElementList(elementList))
}
export function getIsClipboardContainFile(clipboardData: DataTransfer) {
let isFile = false
for (let i = 0; i < clipboardData.items.length; i++) {
const item = clipboardData.items[i]
if (item.kind === 'file') {
isFile = true
break
}
}
return isFile
}