Repainting Decorated Nodes


#1

I am trying to get some transition effects to run when node decorations are added/removed, but when I remove the node decoration (style attribute only, no wrapping node), the decorated DOM node is repainted and the transition does not run.

Is it possible to update the styles of a node decoration without repainting the decorated DOM node?


#2

What exactly are you adding/removing in the decoration? A full repaint of a node when its decorations change shouldn’t happen, but who knows, things may go wrong in some circumstances.


#3

I am adding a padding css property. I have noticed that the decorated nodes do not repaint (just as you wrote) unless I also add a widget decoration. Even then, only the decorated nodes following the widget in the DOM tree repaint.

I’ll dig into this a bit more and see if I can’t provide more details.


#4

I ran some tests going on your description but couldn’t get the behavior to occur (the repaint does manage to resynchronize after adding the widget, and updates existing nodes as intended). If you could reduce this to a minimal test case (maybe in prosemirror-view/test/test-draw-decoration.ts) that’d be useful.