diff --git a/simple-mind-map/src/utils/index.js b/simple-mind-map/src/utils/index.js index 67b913dd..5f0cbf8c 100644 --- a/simple-mind-map/src/utils/index.js +++ b/simple-mind-map/src/utils/index.js @@ -1080,14 +1080,15 @@ export const getDataFromClipboard = async () => { let text = null let img = null if (navigator.clipboard) { - text = await navigator.clipboard.readText() const items = await navigator.clipboard.read() if (items && items.length > 0) { for (const clipboardItem of items) { for (const type of clipboardItem.types) { if (/^image\//.test(type)) { img = await clipboardItem.getType(type) - break + } else if (type === 'text/plain') { + const blob = await clipboardItem.getType(type) + text = await blob.text() } } }