FIX: use plain text if available instead of image upload.

Previously, while pasting from Excel 365 it uploaded a table image instead of markdown table.
This commit is contained in:
Vinoth Kannan 2020-02-12 23:12:32 +05:30
parent 52fe5b938c
commit 9c96511ec4
2 changed files with 3 additions and 3 deletions

View File

@ -674,9 +674,9 @@ export default Component.extend({
return;
}
const { canUpload, canPasteHtml } = clipboardData(e, true);
const { canUpload, canPasteHtml, types } = clipboardData(e, true);
if (!canUpload || canPasteHtml) {
if (!canUpload || canPasteHtml || types.includes("text/plain")) {
e.preventDefault();
}
});

View File

@ -891,7 +891,7 @@ export default Component.extend({
}
}
if (handled || canUpload) {
if (handled || (canUpload && !plainText)) {
e.preventDefault();
}
},