Firing of onInit() after content has been set #788
-
Good day! I have an application where the editor is being passed some initial content from the props. This is how my editor looks like (in mounted):
I would expected that the content would have loaded when Is there any way to get the event handler to fire after the initial content has been set? Or is this a wrong way of doing this? Thanks, |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 1 reply
-
Did you try to work with onUpdate instead of onInit? Maybe that helps. |
Beta Was this translation helpful? Give feedback.
-
I stumbled upon this same issue. The problem with accepted answer is that You can still get the HTML in this.editor = new Editor({
useBuiltInExtensions: false,
extensions: this.extensionList,
content: this.initialContent,
onInit: ({ state, view }) => {
console.log(view.dom.innerHTML)
}
}); Note that you should treat the value as read-only. Changing |
Beta Was this translation helpful? Give feedback.
Did you try to work with onUpdate instead of onInit? Maybe that helps.