#507 fix diff regression when mixing elements and text nodes
This commit is contained in:
parent
6f832a7040
commit
f7cacb7a0b
2 changed files with 7 additions and 1 deletions
|
|
@ -174,7 +174,7 @@ var m = (function app(window, undefined) {
|
|||
for (var prop in existing) actions.push(existing[prop])
|
||||
var changes = actions.sort(sortChanges);
|
||||
var newCached = new Array(cached.length)
|
||||
newCached.nodes = []
|
||||
newCached.nodes = cached.nodes.slice()
|
||||
|
||||
for (var i = 0, change; change = changes[i]; i++) {
|
||||
if (change.action === DELETION) {
|
||||
|
|
|
|||
|
|
@ -917,6 +917,12 @@ function testMithril(mock) {
|
|||
m.render(root, m("div", function() {}))
|
||||
return root.childNodes[0].childNodes.length == 0
|
||||
})
|
||||
test(function() {
|
||||
var root = mock.document.createElement("div")
|
||||
m.render(root, m("div", "foo", m("a")))
|
||||
m.render(root, m("div", "test"))
|
||||
return root.childNodes[0].childNodes.length == 1
|
||||
})
|
||||
//end m.render
|
||||
|
||||
//m.redraw
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue