Skip to content

Bug: Unable to find an active editor state when in editor.update callback fn #4172

Answered by krisantrobus
cfree asked this question in Q&A
Discussion options

You must be logged in to vote

Hi @cfree this is one of the more advanced use cases we had had requested. I have been debugging this and found that the helper functions such as $createTextNode need to come from the Paste library and not the lexical import. However they are not currently exported so I will be creating a ticket to address this.

What I am able to do though is interact with the editor state directly. I have forked your sandbox which can be found here. What I am doing here is getting the state, using the toJSON method and then manipulating the object. I then set the editor state to be the updated state and I can see it reflected. It may get complicated based on the number of paragraph nodes you have so I su…

Replies: 3 comments 6 replies

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
6 replies
@cfree
Comment options

@krisantrobus
Comment options

Answer selected by roxanagomez
@cfree
Comment options

@krisantrobus
Comment options

@cfree
Comment options

@PixeledCode
Comment options

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
4 participants