How to run side-effects inside NodeView's `update` without affecting default ProseMirror render logic?

We have some logic that seems ideal to run in the update function of a NodeView, but whether we return true,false, or nothing from the update function it affects the final rendering in ways that differ from excluding the update function.

Is there any way to run side-effects in update without affecting the default behaviors?

What kind of side effects are you trying to build?

We’re trying to update some DOM state that’s not managed by ProseMirror itself, in response to an update in a ProseMirror node. update seems like the best place to do it, only defining it changes the render behavior regardless of return value.

Is there any approach that might work?

Putting effects beyond the node view’s DOM structure into this update method is going to be a bad idea. But no, an update method that returns false shouldn’t affect the rendering of the node view at all.

@marijn I understand it’s probably a bad idea. Returning false definitely does not behave the same as foregoing the update function altogether though. It’s similar, but it causes the spellcheck lines for every word in the node to flicker off and back on upon each character insertion if you test with nonsense text like asd asd asd - at least not in our editor which uses TipTap v2.

@marijn can you provide any insight into the issue I’m seeing? It sounds like it’s unexpected but it’s definitely the case that defining any update function changes the behavior in Chrome on desktop.

If you can reduce it to a minimal script that demonstrates it, sure. From your current description, I don’t know what you may be doing.