[FIX] component: in slots, qweb was looking in wrong component

In slots, the actual parent is where the system should look for existing
widgets, not the rendering context.

closes #239
This commit is contained in:
Géry Debongnie
2019-07-11 14:00:15 +02:00
parent bfc7c81c0d
commit ea015af741
5 changed files with 102 additions and 62 deletions
+2 -2
View File
@@ -517,7 +517,7 @@ QWeb.addDirective({
}
ctx.addLine(
`let w${componentID} = ${templateID} in context.__owl__.cmap ? context.__owl__.children[context.__owl__.cmap[${templateID}]] : false;`
`let w${componentID} = ${templateID} in parent.__owl__.cmap ? parent.__owl__.children[parent.__owl__.cmap[${templateID}]] : false;`
);
ctx.addLine(`let _${dummyID}_index = c${ctx.parentNode}.length;`);
if (async) {
@@ -554,7 +554,7 @@ QWeb.addDirective({
ctx.addLine(`utils.validateProps(W${componentID}, props${componentID})`);
}
ctx.addLine(`w${componentID} = new W${componentID}(parent, props${componentID});`);
ctx.addLine(`context.__owl__.cmap[${templateID}] = w${componentID}.__owl__.id;`);
ctx.addLine(`parent.__owl__.cmap[${templateID}] = w${componentID}.__owl__.id;`);
// SLOTS
const varDefs: string[] = [];