Custom text selection for leaf node #437
Unanswered
mustseesun
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
-
Hi there!
I did custom node view for create
<span></span>
that store data from BE in attributes. Also, I useangular-elements
to render the custom angular component over thisspan
tag. This custom angular component is omitted from prosemirror state, but the result of his work is 1 final output string that I store in the prosemirror state.This approach works well for every mark, except
text_color
andtext_background_color
. As I understand that because prosemirror has no idea how to set color/bg-color for leaf node types. Hencediv
insidengx-color-picker
inside default toolbar menu is disabled for both (text_color
andtext_background_color
marks).So I want to make some type of custom selection function and apply it to the final output text string (that is stored in prosemirror state, so it shouldn't be an issue) on a
selectNode
event, hencetext_color
andtext_background_color
which presented withngx-color-picker
's will be enabled for this type of leaf node.How is it possible to be done? I'm new with prosemirror and ngx-editor and not sure if this approach is the right way and how it can be done. So please feel free to share any of your vision or experience.
Thanks!
Beta Was this translation helpful? Give feedback.
All reactions