[FIX] app, components: dynamic t-call should propagate the key

Have a Component which has a Component node, and a dynamic t-call itself having
a Component node.

Before this commit, both children had the same `key`, (as in the key in parent.children, which registers on the parent all its children).

As a result, the scheduler was endlessly hanging.

After this commit, it works as expected.
This commit is contained in:
Lucas Perais (lpe)
2022-01-10 15:20:13 +01:00
committed by Aaron Bohy
parent 3e1fe07ba7
commit 4b170b9b45
3 changed files with 65 additions and 2 deletions
+2 -2
View File
@@ -51,9 +51,9 @@ export class TemplateSet {
translateFn?: (s: string) => string;
translatableAttributes?: string[];
utils: typeof UTILS = Object.assign({}, UTILS, {
call: (owner: any, subTemplate: string, ctx: any, parent: any) => {
call: (owner: any, subTemplate: string, ctx: any, parent: any, key: any) => {
const template = this.getTemplate(subTemplate);
return toggler(subTemplate, template.call(owner, ctx, parent));
return toggler(subTemplate, template.call(owner, ctx, parent, key));
},
getTemplate: (name: string) => this.getTemplate(name),
});