quill-image-drop-and-paste
quill-image-drop-and-paste copied to clipboard
Image drop issue
When I dropped a first pic, it is fine. But when I want to drop a second pic after the first one, it was always dropped before the first pic and cannot be dropped after it.
try to change the index on the custom image handler.
function imageHandler(imageDataUrl, type, imageData) {
// ...
let index = (quill.getSelection() || {}).index
if (index === undefined || index < 0) index = quill.getLength()
quill.insertEmbed(index, 'image', res.data.image_url, 'user')
}