NodeView.update not called for some actions

I have a NodeView with an iframe-based editing widget. I’m noticing that some transforms above the widget don’t hit update and always re-render.

  • New line from end of paragraph doesn’t hit update, causes rerender
  • Splitting a paragraph into 2 does hit update

I’m seeing the same issue stepping through the CodeMirror demo: the constructor is called in some cases when it shouldn’t be, without trying update.

If that map widget is a block node, I can’t reproduce this issue. If it’s inline in a paragraph node, this patch should help.

I have a very similar issue with a block node, which gets rerendered when a new empty paragraph is inserted somewhere above it. It contains an iframe which is why the rerender is very obvious (flickers). I’m not using a NodeView in this case. Unfortunately I haven’t been able to reproduce this inside an isolated ProseMirror instance yet, but I will give an update as soon as I find out more about this.

I thought I was seeing the same with breakpoints in constructor and update of the nodeview demo, but now it seems to be working as expected. I’ll look at my code more.

Narrowed it down to a plugin that mutated PM’s content DOM: … I guess that should be decorators now that we have them.

Absolutely. ProseMirror’s mutation observer will pick these up and mark the nodes as being in need of a redraw.