# NodeView.update not called for some actions

**URL:** https://discuss.prosemirror.net/t/nodeview-update-not-called-for-some-actions/540
**Category:** Uncategorized
**Created:** [December 21, 2016, 9:00pm UTC](https://discuss.prosemirror.net/t/nodeview-update-not-called-for-some-actions/540 "2016-12-21T21:00:46Z")
**Posts on this page:** 6
**Page:** 1

<div class="post-metadata">

### Author: ![forresto](https://discuss.prosemirror.net/user_avatar/discuss.prosemirror.net/forresto/32/108_2.png) [@forresto](https://discuss.prosemirror.net/u/forresto)
#### Post date: [December 21, 2016, 9:00pm UTC](https://discuss.prosemirror.net/t/nodeview-update-not-called-for-some-actions/540/1 "2016-12-21T21:00:46Z")

</div>

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

![](https://discuss.prosemirror.net/uploads/secondsite/original/1X/1b31abd33d75ab7ef6a4fd92b42b13e4eea45f0f.gif)

I’m seeing the same issue stepping through the [CodeMirror demo](http://prosemirror.net/demo/nodeview.html): the constructor is called in some cases when it shouldn’t be, without trying `update`.

---

<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: [December 22, 2016, 8:38am UTC](https://discuss.prosemirror.net/t/nodeview-update-not-called-for-some-actions/540/2 "2016-12-22T08:38:55Z")

</div>

If that map widget is a block node, I can’t reproduce this issue. If it’s inline in a paragraph node, [this patch](https://github.com/ProseMirror/prosemirror-view/commit/0facc8514ecfbb26611346b76b1ae646b74274b6) should help.

---

<div class="post-metadata">

### Author: ![kiejo](https://discuss.prosemirror.net/user_avatar/discuss.prosemirror.net/kiejo/32/64_2.png) [@kiejo](https://discuss.prosemirror.net/u/kiejo)
#### Post date: [December 22, 2016, 11:22am UTC](https://discuss.prosemirror.net/t/nodeview-update-not-called-for-some-actions/540/3 "2016-12-22T11:22:50Z")

</div>

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.

---

<div class="post-metadata">

### Author: ![forresto](https://discuss.prosemirror.net/user_avatar/discuss.prosemirror.net/forresto/32/108_2.png) [@forresto](https://discuss.prosemirror.net/u/forresto)
#### Post date: [December 22, 2016, 1:27pm UTC](https://discuss.prosemirror.net/t/nodeview-update-not-called-for-some-actions/540/4 "2016-12-22T13:27:45Z")

</div>

I thought I was seeing the same with breakpoints in `constructor` and `update` of [the nodeview demo](http://prosemirror.net/demo/nodeview.html), but now it seems to be working as expected. I’ll look at my code more.

---

<div class="post-metadata">

### Author: ![forresto](https://discuss.prosemirror.net/user_avatar/discuss.prosemirror.net/forresto/32/108_2.png) [@forresto](https://discuss.prosemirror.net/u/forresto)
#### Post date: [December 22, 2016, 1:48pm UTC](https://discuss.prosemirror.net/t/nodeview-update-not-called-for-some-actions/540/5 "2016-12-22T13:48:13Z")

</div>

Narrowed it down to a plugin that mutated PM’s content DOM: [https://github.com/the-grid/ed/commit/f1e8a256566f31a89c6e21bfe4248d606d545faf](https://github.com/the-grid/ed/commit/f1e8a256566f31a89c6e21bfe4248d606d545faf) … I guess that should be decorators now that we have them.

---

<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: [December 22, 2016, 4:17pm UTC](https://discuss.prosemirror.net/t/nodeview-update-not-called-for-some-actions/540/6 "2016-12-22T16:17:05Z")

</div>

> [@forresto](#):
>
> 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.
