Best way to insert/update custom text node on selection #4508
Unanswered
mihajlovco
asked this question in
Q&A
Replies: 1 comment
-
@mihajlovco Do you have a solution yet? |
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
-
What is the best way to insert/update a custom text node without losing the styles from the previous state?
I have a custom
FontColorNode
text node that takestheme style name
from the global theme orcustom color hex value
.Problems that occurred to me:
When I insert the new node:
But when I insert the node, the selection of text from the previous node is lost.
when I select part of the
FontColorNode
text and try to update the node (bold, underline, other theme style name) then half of the text styles will be lost including the theme style name or the custom color.I am using
$insertNodes
to insert/update the nodes.Do you have some code samples or how can I modify this code to have correct updates.
Beta Was this translation helpful? Give feedback.
All reactions