editable node w/ focus is updated when data is changed.

This commit is contained in:
Igor Kurganov 2016-12-09 17:37:14 -08:00
parent 544bb503b9
commit caaa8c9cbe
2 changed files with 21 additions and 1 deletions

View file

@ -1589,5 +1589,25 @@ describe("m.render()", function () {
expect(root.childNodes[0].innerHTML).to.equal(t1.valueOf())
})
it("caches children of editable on update", function () {
var root = document.createElement('div')
// need this in order for focus & activeElement to work properly
document.body.appendChild(root)
m.render(root, m('span', {
config: function(el) { el.focus() },
contenteditable: true
}, 'a'))
m.render(root, m('span', {
config: function(el) { el.focus() },
contenteditable: true
}, 'b'))
expect(root.childNodes[0].innerHTML).to.equal('b')
})
})
})