Hi,
The paste event of an image is stopped by _processBlobItems. (tui-editor-Editor.js 2239)
What is the correct way to catch this event and handle the data ?
What I've done so far is inserting my custom listener at the first position in the eventManager.
Something like that:
var pasteListener = (event) => {
var cbData = event.data.clipboardData;
var types = cbData && cbData.types;
if (types.includes("Files")) {
event.preventDefault();
event.stopPropagation();
}
};
tuiEditor.eventManager.events.set('paste', [pasteListener, ...tuiEditor.eventManager.events.get('paste')]);
In case pasting image, we need to emit addImageBlobHook hook and load image using FileReader.
Why you need paste event for image? If you give me for more detail information, I will check it.
I think it's following use case:
The user has image data in his clipboard and simply wants to insert an image in editor by pressing ctrl+v without using buttons of editor. This would result in a huge usability improvement.
This issue has been automatically marked as inactive because there hasn鈥檛 been much going on it lately. It is going to be closed after 7 days. Thanks!
This issue will be closed due to inactivity. Thanks for your contribution!
Most helpful comment
I think it's following use case:
The user has image data in his clipboard and simply wants to insert an image in editor by pressing ctrl+v without using buttons of editor. This would result in a huge usability improvement.