fix: properly destroy/detach widgets in some cases

Sometimes, widgets were not properly destroyed/detached. This was caused
by the fact that we used the hook remove, when we sometimes need to use
the hook destroy as well.
This commit is contained in:
Géry Debongnie
2019-03-29 12:50:45 +01:00
parent 1e58c7b12b
commit 5cd45b59af
3 changed files with 44 additions and 3 deletions
+2
View File
@@ -981,6 +981,8 @@ const widgetDirective: Directive = {
ctx.parentNode
}[_${dummyID}_index]=pvnode;pvnode.data.hook = {insert(vn){let nvn=w${widgetID}._mount(vnode, vn.elm);pvnode.elm=nvn.elm},remove(){w${widgetID}.${
keepAlive ? "detach" : "destroy"
}()},destroy(){w${widgetID}.${
keepAlive ? "detach" : "destroy"
}()}}; w${widgetID}.__widget__.pvnode = pvnode;});`
);
ctx.addElse();