[FIX] component: force mounting subcomponents with shouldUpdate

Components can implement shouldUpdate to return false.  In that case,
renderings coming from above should be ignored.

However, if the component was unmounted and is remounted, we actually
need to force a rerendering in that case, so it is mounted, otherwise
the subcomponent is left in unmounted state, which means that rendering
are ignored.

closes #800
This commit is contained in:
Géry Debongnie
2020-12-11 15:03:44 +01:00
committed by aab-odoo
parent f54b9a4a0c
commit 2a53a9592e
2 changed files with 48 additions and 1 deletions
+1 -1
View File
@@ -333,7 +333,7 @@ export class Component<Props extends {} = any, T extends Env = Env> {
message += `\nMaybe the DOM is not ready yet? (in that case, you can use owl.utils.whenReady)`;
throw new Error(message);
}
const fiber = new Fiber(null, this, false, target, position);
const fiber = new Fiber(null, this, true, target, position);
fiber.shouldPatch = false;
if (!__owl__.vnode) {
this.__prepareAndRender(fiber, () => {});