Setting the inner text of a link node #5608
Replies: 1 comment
-
I managed to produce the behaviour I wanted this way:
The idea is to use the overload of |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
I'm trying to build a form to insert a new Link, the behavior I intend to achieve is that I'll have an optional
Title
input in a form, then I'll check if the editor had a text selection when opening the formmy form submit handler looks something like this
My issue is that the
selectParentNode
method is going to do what it's designed to do 😅, so that if I have a node that looks like<p>this is a paragraph</p>
and select the text"paragraph"
the whole paragraph node is being made into a Link mark, but if I skip theselectParentNode
method nothing is marked as Link.In other words: it seems that by invoking
insertContent
I'm losing the current selection (which makes sense since the length of the text has probably changed) how can I select what I just inserted?Beta Was this translation helpful? Give feedback.
All reactions