editor.js icon indicating copy to clipboard operation
editor.js copied to clipboard

Get onPaste() event information in render()

Open tom-byrom opened this issue 6 months ago • 0 comments

It seems that onPaste() fires after render(), I need to access whether or not the render() has been triggered by onPaste()... Anyway to do this or pass the onPaste() event information into the render()?

Use case, I have created an image upload plugin. The render() creates a file input which I then trigger an onClick event so it opens up the file browser straight away. Clicking add image then clicking another button to add image is horrible UX.

However, onPaste() this is onClick event is not required for dragging and dropping images etc. And currently dragging and dropping images will still open the file browser after pasting because the input is still created and the onClick happens before the onPaste() code runs.

The onPaste() code runs after render() I need a way to check if the render() is triggered by and onPaste event so I can disable this input onClick event.

Thanks

tom-byrom avatar Aug 07 '24 19:08 tom-byrom