diff --git a/mithril.js b/mithril.js index 20a59720..f4790019 100644 --- a/mithril.js +++ b/mithril.js @@ -533,6 +533,7 @@ } else if (editable) { // contenteditable nodes use `innerHTML` instead of `nodeValue`. editable.innerHTML = data + nodes = [].slice.call(editable.childNodes) } else { // was a trusted string if (nodes[0].nodeType === 1 || nodes.length > 1 || diff --git a/test/mithril.render.js b/test/mithril.render.js index c2c56b5a..f851de58 100644 --- a/test/mithril.render.js +++ b/test/mithril.render.js @@ -1577,5 +1577,18 @@ describe("m.render()", function () { // This works only if select value is set after its options exist. expect(root.childNodes[0].value).to.equal("b") }) + + it("caches children of editable on update", function () { + var root = document.createElement("span") + var t1 = m.trust("