Injecting content from another component into the editor #2750
Unanswered
FedericoCampe8
asked this question in
Q&A
Replies: 1 comment 5 replies
-
Plate's |
Beta Was this translation helpful? Give feedback.
5 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hello, I'm looking at ways to inject data (text for now) into Plate editor from another react component (e.g., a textbox). The user would be able to type some text into a textbox, click on a button and the text gets "injected" into Plate possibly rendered with a given specified color.
I'm currently using editor.insertData() with 'text/plain' and my question is: is this the recommended way? Do I need a plugin on plate side to fetch this data and create specific nodes with the proper text color?
If so, how do I ensure that I'm not changing behavior to the existing plugins dealing with insertion? For example, I don't want the text to be colored when I drag and drop text (that also triggers insertData I believe).
Thanks!
Beta Was this translation helpful? Give feedback.
All reactions