-
-
Notifications
You must be signed in to change notification settings - Fork 2.1k
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
React: Clicks on custom plugin with react component are not propagated #946
Comments
Try this
I did not find a way to call api.listeners.off in useEffect and ReactDOM.unmountComponentAtNode(container) when block delete. |
I forgot to say thank you @IzotovDenis, so thanks! For anyone interested: @allankikkas came up with a better (does not use |
Resolved by #1252 |
Merged
Merged
# for free
to join this conversation on GitHub.
Already have an account?
# to comment
Issue
When rendering a React component in the plugin's
render
method, clicks on the React element do not trigger it'sonClick
.Expected outcome
I can interact with the react component properly (eg.
onClick
is invoked).Example
An example codesandbox can be found here: https://codesandbox.io/s/solitary-night-96hzk?fontsize=14. After some more testing it looks like eg.
onChange
oninput
elements is not an issue: https://codesandbox.io/s/sweet-resonance-p7xwu.The React component
Environment
"react": "16.11.0"
"@editorjs/editorjs": "2.15.1"
Related Issues/Topics
@gohabereg already posted a gif illustrating the issue:
And I created another one. As soon as you select some text, it works:
The text was updated successfully, but these errors were encountered: