[FIX] component: do not call willPatch/patched if not in DOM

closes #62
This commit is contained in:
Géry Debongnie
2019-04-26 15:30:59 +02:00
parent b6bd0f92a7
commit b44f274e37
3 changed files with 49 additions and 4 deletions
+5 -2
View File
@@ -329,9 +329,12 @@ export class Component<
_patch(vnode) {
this.__owl__.renderPromise = null;
if (this.__owl__.vnode) {
const snapshot = this.willPatch();
const isMounted = this.__owl__.isMounted;
const snapshot = isMounted && this.willPatch();
this.__owl__.vnode = patch(this.__owl__.vnode, vnode);
this.patched(snapshot);
if (isMounted) {
this.patched(snapshot);
}
} else {
this.__owl__.vnode = patch(document.createElement(vnode.sel!), vnode);
}