quill-image-drop-and-paste icon indicating copy to clipboard operation
quill-image-drop-and-paste copied to clipboard

Image drop issue

Open gyang55 opened this issue 1 year ago • 1 comments

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.

gyang55 avatar Nov 17 '23 01:11 gyang55

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')
}

chenjuneking avatar Mar 13 '24 17:03 chenjuneking