Skip to content

Commit

Permalink
fix: 🐛 use insertText replace insertHTML (#27)
Browse files Browse the repository at this point in the history
* fix: 🐛 use insertText replace insertHTML
  • Loading branch information
bingryan authored Apr 26, 2023
1 parent 8f96527 commit c230c53
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/components/EditableContent/index.vue
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,9 @@
// text
if (items[i].type.indexOf('text/plain') !== -1) {
items[i].getAsString((str) => {
document.execCommand('insertHTML', false, str);
// when str is html tag, use insertHTML
// when str is plain text, use insertText
document.execCommand('insertText', false, str);
});
}
Expand Down

0 comments on commit c230c53

Please sign in to comment.