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

Duplicate image on paste

Open Eraldo opened this issue 1 year ago • 5 comments

I have defined a custom image handler and that does trigger a modal to upload an image and that does work. I also replaced it with a function that only does alert("Works!"); just to be sure it's not the cause of my issue.

However immediately upon pasting the image inside the editor, I immediately get an inserted image as a string blob inserted into the editor. This way after continuing with my upload modal, I end up having two images. Once the inline string blob and once an image tag with my uploaded image as src.

PS: There is a typo in the docs: "didnot" => "did not". ;)

If you didnot config a image handler, it will insert the image with dataURL into the quill editor directory after your drop/paste.

Any help on how to prevent the default behaviour is highly appreciated. 🙏

Eraldo avatar Mar 02 '24 16:03 Eraldo

Sorry for your trouble, could you provide some codes or screen videos showing the issue?

chenjuneking avatar Mar 13 '24 16:03 chenjuneking

Sorry for your trouble, could you provide some codes or screen videos showing the issue?

Sure, thanks for asking: https://youtu.be/245KPVeXZ3g

Eraldo avatar Apr 08 '24 15:04 Eraldo

same

linxianxi avatar Jun 03 '24 09:06 linxianxi

Also experiencing this.

"ngx-quill": "~25.3.0",
"parchment": "~3.0.0",
"quill": "~2.0.2",
"quill-image-drop-and-paste": "~1.3.0"

dalexander-trc avatar Jun 10 '24 14:06 dalexander-trc

same

granawkins avatar Jun 20 '24 00:06 granawkins

Hi all, it looks like Quill >2.0.0 might have added native image upload functionality which conflicts with this module, hence duplicate uploads. If you want to fix the duplicate issue easily, just add uploader: { handler: () => {} }, to your modules list in Quill, or do something like this:

class NoopClass {}

Quill.register({
  "modules/uploader": NoopClass
}, true);

I don't know if the native version is better or worse, just that this fixes it. Cheers.

VaguelySerious avatar Jul 22 '24 12:07 VaguelySerious

fixed on version ^2.0.0.

chenjuneking avatar Aug 07 '24 17:08 chenjuneking