No, I’m using React to render the paragraph.
const view = new EditorView(
{ mount: ref.current },
{
state,
nodeViews: {
paragraph(node) {
return new ParagraphView(node);
}
}
}
);
The heading is using the toDOM
setup from prosemirror-schema-basic
. And yes, I can confirm that the node is being recreated, though I’m surprised that the selection is being lost when this happens. Changing the block type on the editor from the Prosemirror homepage retains the selection, for example.
I’m also including an ignoreMutation
method that returns false for selection events, to leave Prosemirror in charge of managing the selection.
ignoreMutation(mutation) {
if (mutation.type === "selection") return false;
return !this.contentDOM.contains(mutation.target);
}