Bug fix for issue with diffing child nodes.

This commit is contained in:
Aaron Craelius 2014-11-27 14:47:00 -05:00
parent bb8de6dabb
commit 03cf8e9826

View file

@ -578,11 +578,12 @@
(if (and (sequential? new-child) (not (keyword? (first new-child)))) (if (and (sequential? new-child) (not (keyword? (first new-child))))
(let [cur-child (try-diff-subseq parent cur-child new-child)] (let [cur-child (try-diff-subseq parent cur-child new-child)]
(recur cur-child (first more) (rest more))) (recur cur-child (first more) (rest more)))
(do (let [next-sib (.-nextSibling cur-child)]
(replace-child parent new-child cur-child false) (replace-child parent new-child cur-child false)
(recur (.-nextSibling cur-child) (first more) (rest more)))) (recur next-sib (first more) (rest more))))
(do (do
(append-children! parent new-children) (append-child! parent new-child)
(append-children! parent more)
nil)) nil))
cur-child))) cur-child)))
@ -594,7 +595,7 @@
cur-dom-node cur-dom-node
(if (keyword-identical? new-tag cur-tag) (if (keyword-identical? new-tag cur-tag)
(do (do
;(println "diff hit" (first vdom)) ;(println "diff hit" (first vdom) (.-id cur-state))
(let [old-attrs (.-attrs cur-state) (let [old-attrs (.-attrs cur-state)
new-attrs? (second vdom) new-attrs? (second vdom)
new-attrs (when (map? new-attrs?) new-attrs?)] new-attrs (when (map? new-attrs?) new-attrs?)]