diff --git a/doc/component.md b/doc/component.md index ea7328b4..797ad3d0 100644 --- a/doc/component.md +++ b/doc/component.md @@ -200,7 +200,7 @@ a owl component: | ------------------------------------------------ | --------------------------------------- | | **[constructor](#constructor)** | constructor | | **[willStart](#willStart)** | async, before first rendering | -| **[mounted](#mounted)** | when component is render and in DOM | +| **[mounted](#mounted)** | just after component is rendered and added to the DOM | | **[willUpdateProps](#willupdatepropsnextprops)** | async, before props update | | **[willPatch](#willpatch)** | just before the DOM is patched | | **[patched](#patchedsnapshot)** | just after the DOM is patched | diff --git a/src/component.ts b/src/component.ts index c7cae77c..b76a41cb 100644 --- a/src/component.ts +++ b/src/component.ts @@ -248,7 +248,8 @@ export class Component< const renderVDom = this._render(force, patchQueue); const renderId = this.__owl__.renderId; const vnode = await renderVDom; - if (renderId === this.__owl__.renderId) { + + if (this.__owl__.isMounted && renderId === this.__owl__.renderId) { // we only update the vnode and the actual DOM if no other rendering // occurred between now and when the render method was initially called. if (shouldCallPatchHooks) { diff --git a/tests/component.test.ts b/tests/component.test.ts index 8204358f..0a2185b4 100644 --- a/tests/component.test.ts +++ b/tests/component.test.ts @@ -1645,6 +1645,59 @@ describe("async rendering", () => { "