Bug fix for issue with diffing child nodes.
This commit is contained in:
parent
bb8de6dabb
commit
03cf8e9826
1 changed files with 5 additions and 4 deletions
|
@ -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?)]
|
||||||
|
|
Loading…
Reference in a new issue