mirror of
https://github.com/odoo/owl.git
synced 2025-10-06 19:59:41 +07:00
[FIX] component: do not call willPatch/patched if not in DOM
closes #62
This commit is contained in:
+5
-2
@@ -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);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user