prevent recycling for vnodes w/ integration methods

This commit is contained in:
Leo Horie 2016-05-19 01:20:21 -04:00
parent 73cfe3dd7a
commit b4903538f3
6 changed files with 35 additions and 16 deletions

View file

@ -319,7 +319,7 @@ module.exports = function($window) {
}
}
if (vnode.dom.parentNode != null) parent.removeChild(vnode.dom)
if (context != null && vnode.domSize == null) { //TODO test custom elements
if (context != null && vnode.domSize == null && !hasIntegrationMethods(vnode)) { //TODO test custom elements
if (!context.pool) context.pool = [vnode]
else context.pool.push(vnode)
}
@ -393,6 +393,9 @@ module.exports = function($window) {
function isAttribute(attr) {
return attr === "href" || attr === "list" || attr === "form"// || attr === "type" || attr === "width" || attr === "height"
}
function hasIntegrationMethods(vnode) {
return vnode.attrs != null && (vnode.attrs.oncreate || vnode.attrs.onupdate || vnode.attrs.onbeforeremove || vnode.attrs.onremove)
}
//style
function updateStyle(element, old, style) {