codex-team / editor.js

A block-style editor with clean JSON output
https://editorjs.io
Apache License 2.0
28.52k stars 2.08k forks source link

Drop interaction with onPaste function #1522

Open Nico-L opened 3 years ago

Nico-L commented 3 years ago

The question. I am working on the gallery plugin that can be populated by dropping images on one its element. I am also using the simple-image plugin that has a onPaste function that interacts with the drop function of my plugin : on dropping the images, they are added to the gallery plugin, but also as new image blocks.

Would there be a solution to prevent the simple-image plugin to be fired when the gallery is used?

Thanks

Nico-L commented 3 years ago

Hi, I have a gallery plugin mostly working though quite crude. This is now my only plugin dealing with images. I am still struggling with the drop of several files. Currently the onPaste event only deals with one file. If several files are pasted/dropped, Editorjs creates several instances of the plugin.

Would there be a workaround to prevent the creation of several instances of the plugin? I have looked to the merge function but it is not fired when several galleries are created.

Thanks

scratcher28 commented 3 years ago

I am having the same issue