codex-team / codex-team/editor.js

Get onPaste() event information in render()

Open
#2,807 0 comments 1 reaction 0 assignees View on GitHub
Dominant language
TypeScript
Stars
31.9k
Forks
2.2k
Avg merge
1d 1h
Merged PRs (30d)
1

Description

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

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.