How do I programmatically insert text using the Chrome extension on Slate document? #5721
Unanswered
rahulbansal16
asked this question in
Q&A
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
So I want to understand how I would be able to insert text on the websites where Slate is used. The current way I'm doing it is by copying the content to the clipboard and then using
document.execCommand('insertText', false, content); // Simulate paste
to call the insert text.
The problem is it doesn't work everywhere, especially in Slate editor. It works for the normal text area, Gmail, and others, but on websites where Slate document is used, it doesn't work. It just inserts the text in the location; it doesn't create the string node that is required.
Correct way to insert text
but Simulating Paste insert text like below
Any suggestion on inserting text correctly?
Beta Was this translation helpful? Give feedback.
All reactions