Replies: 2 comments
-
|
Interesting ideas - looks like we have another issue around this too: #3200 |
Beta Was this translation helpful? Give feedback.
0 replies
-
|
Ah, yes, I actually ended up with the same hacky workaround. But I figured it was a bug since it seemed logical to me that tranforms would also be called on setEditorState. Otherwise nodes just 'magically'/suddenly transform when they're marked as dirty later on. On the other hand, a primitive to force node transforms to run may be more flexible. |
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
Uh oh!
There was an error while loading. Please reload this page.
-
I have a node type that generates additional helper nodes as part of a node transform.
However, in some circumstances I am updating the lexical state using
parseEditorStateto create a newEditorStateand then setting it usingsetEditorState.When I perform these steps, the node transforms are not run and hence the helper nodes are not generated.
I can't force these helper nodes to be generated in
importJSONsince it relies on the node's children being present andimportJSONnever sees the children for the node (unlikeimportDOMwhich can provide anaftercallback for each conversion).I can force the node transforms to be run by borrowing the relevant bit of code from
markAllNodesAsDirty:However, it seems fragile to be reaching into
_nodeMaplike this.How should this work?
setEditorStatedo it automatically?importDOMto update the node after its children have been attached?Any ideas?
Beta Was this translation helpful? Give feedback.
All reactions