Fix patch() so that the root is patched instead of recreated
Previously, patch(element, vnode) would create a new element every time for the top-level element, unless the top-level vnode had no id and className. This is because emptyNodeAt() would create a vnode with sel equal to the element's tagName, NOT including id and className. This seems to be just a small fix, however this fix was crucial to get Web Components (custom elements) working with Cycle.js, because the custom element's "create" callback was being called infinitely and recursively, because snabbdom was creating the top-level element every time, even if the sel of oldVNode and vnode were supposed to be the same.pull/159/head
parent
f178f91dfa
commit
c091c59c59
Loading…
Reference in New Issue