# Repainting Decorated Nodes

**URL:** <https://discuss.prosemirror.net/t/repainting-decorated-nodes/1434>\
**Category:** Uncategorized\
**Created:** [July 21, 2018, 10:22am UTC](https://discuss.prosemirror.net/t/repainting-decorated-nodes/1434 "2018-07-21T10:22:22Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![supersonicecho](https://discuss.prosemirror.net/user_avatar/discuss.prosemirror.net/supersonicecho/32/539_2.png) [@supersonicecho](https://discuss.prosemirror.net/u/supersonicecho)\
**Post date:** [July 21, 2018, 10:22am UTC](https://discuss.prosemirror.net/t/repainting-decorated-nodes/1434/1 "2018-07-21T10:22:22Z")

</div>

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?

---

<div class="post-metadata">

**Author:** ![marijn](https://discuss.prosemirror.net/user_avatar/discuss.prosemirror.net/marijn/32/15_2.png) [@marijn](https://discuss.prosemirror.net/u/marijn)\
**Post date:** [July 21, 2018, 2:10pm UTC](https://discuss.prosemirror.net/t/repainting-decorated-nodes/1434/2 "2018-07-21T14:10:51Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![supersonicecho](https://discuss.prosemirror.net/user_avatar/discuss.prosemirror.net/supersonicecho/32/539_2.png) [@supersonicecho](https://discuss.prosemirror.net/u/supersonicecho)\
**Post date:** [July 21, 2018, 7:13pm UTC](https://discuss.prosemirror.net/t/repainting-decorated-nodes/1434/3 "2018-07-21T19:13:20Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![marijn](https://discuss.prosemirror.net/user_avatar/discuss.prosemirror.net/marijn/32/15_2.png) [@marijn](https://discuss.prosemirror.net/u/marijn)\
**Post date:** [July 24, 2018, 10:23am UTC](https://discuss.prosemirror.net/t/repainting-decorated-nodes/1434/4 "2018-07-24T10:23:31Z")

</div>

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.
