Fix incorrect WYSIWYG image insertion position

This commit is contained in:
Kailash Nadh 2020-07-06 19:46:18 +05:30
parent 1b346b1c2b
commit 3e755596c7
1 changed files with 5 additions and 1 deletions

View File

@ -193,7 +193,11 @@ export default {
}, },
onMediaSelect(m) { onMediaSelect(m) {
this.$refs.quill.quill.insertEmbed(10, 'image', m.url); const sel = this.$refs.quill.quill.getSelection();
if (!sel) {
return;
}
this.$refs.quill.quill.insertEmbed(sel.index, 'image', m.url);
}, },
}, },