NodeView .update not called - bug?

I have a problem in my app of a .update method not getting called. I’ve reduced the issue to a minimal example. I’m not sure if it’s a bug or if I’m misusing the API somehow.

I have a doc with just one node, with a node-view that displays a button. I would expect that on clicking the button I would see a message in the console but I don’t.

During testing I noticed things seem to behave properly when the editor is not mounted in the DOM. I’ve included a demonstration of this in the example code (so in fact I would expect to see two messages in the console but I only see one)

I try the test but my console show two messages.

My best guess is you change the node attribute or structure by click, so node get recreate by that, checkout the ignoreMutation option with nodeView, just return true and see what happens.

function buttonView(node, view) {
  const button = document.createElement('button')
  button.textContent = node.attrs.label
  button.onclick = changeBoth
  
  return {
    dom: button,
    update(node) {
      console.log('update', view.tag)
      button.textContent = node.attrs.label
      return true
    },
    // this line
    ignoreMutation: () => true
  }
}

Thanks very much for posting - the fact that it worked for you led me to suspect an extension. It turns out to be an issue with ProseMirror Developer Tools (which is awesome, btw)

Will file an issue.