Fixed redraw problem if child text node is substituted with a non-text node.
h3rald h3rald@h3rald.com
Tue, 28 Apr 2020 10:06:24 +0200
1 files changed,
4 insertions(+),
9 deletions(-)
jump to
M
h3.js
→
h3.js
@@ -426,15 +426,10 @@ if (equal(newmap, oldmap) && (notFoundInNew >= 0 || notFoundInOld >= 0)) {
// Something changed for (let i = 0; i < newmap.length; i++) { if (newmap[i] === -1) { - if (oldvnode.children[i].type === "#text") { - oldvnode.children[i] = newvnode.children[i]; - node.childNodes[i].nodeValue = newvnode.children[i].value; - } else { - oldvnode.children[i].redraw({ - node: node.childNodes[i], - vnode: newvnode.children[i], - }); - } + oldvnode.children[i].redraw({ + node: node.childNodes[i], + vnode: newvnode.children[i], + }); } } } else {