fix recycling when tag is different in unkeyed node
This commit is contained in:
parent
c196b8b475
commit
7227cc546f
3 changed files with 33 additions and 5 deletions
|
|
@ -787,4 +787,30 @@ o.spec("updateNodes", function() {
|
|||
o(vnodes[0].dom.firstChild).equals(updated[0].dom.firstChild)
|
||||
o(updated[0].dom.firstChild.nodeName).equals("A")
|
||||
})
|
||||
o("mixed unkeyed tags are not broken by recycle", function() {
|
||||
var vnodes = [{tag: "a"}, {tag: "b"}]
|
||||
var temp = [{tag: "b"}]
|
||||
var updated = [{tag: "a"}, {tag: "b"}]
|
||||
|
||||
render(root, vnodes)
|
||||
render(root, temp)
|
||||
render(root, updated)
|
||||
|
||||
o(root.childNodes.length).equals(2)
|
||||
o(root.childNodes[0].nodeName).equals("A")
|
||||
o(root.childNodes[1].nodeName).equals("B")
|
||||
})
|
||||
o("mixed unkeyed vnode types are not broken by recycle", function() {
|
||||
var vnodes = [{tag: "[", children: [{tag: "a"}]}, {tag: "b"}]
|
||||
var temp = [{tag: "b"}]
|
||||
var updated = [{tag: "[", children: [{tag: "a"}]}, {tag: "b"}]
|
||||
|
||||
render(root, vnodes)
|
||||
render(root, temp)
|
||||
render(root, updated)
|
||||
|
||||
o(root.childNodes.length).equals(2)
|
||||
o(root.childNodes[0].nodeName).equals("A")
|
||||
o(root.childNodes[1].nodeName).equals("B")
|
||||
})
|
||||
})
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue