mirror of
https://github.com/odoo/owl.git
synced 2025-10-06 19:59:41 +07:00
[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:
committed by
Aaron Bohy
parent
3e1fe07ba7
commit
4b170b9b45
@@ -183,4 +183,27 @@ describe("t-call", () => {
|
||||
fixture.querySelector("p")!.click();
|
||||
expect(value).toBe(3);
|
||||
});
|
||||
|
||||
test("dynamic t-call: key is propagated", async () => {
|
||||
let childId = 0;
|
||||
class Child extends Component {
|
||||
static template = xml`<div t-att-id="id" />`;
|
||||
id: any;
|
||||
setup() {
|
||||
this.id = childId++;
|
||||
}
|
||||
}
|
||||
const sub = xml`<Child />`;
|
||||
|
||||
class Parent extends Component {
|
||||
static template = xml`<Child /><t t-call="{{ sub }}"/>`;
|
||||
static components = { Child };
|
||||
|
||||
sub = sub;
|
||||
}
|
||||
|
||||
await mount(Parent, fixture);
|
||||
|
||||
expect(fixture.innerHTML).toBe(`<div id="0"></div><div id="1"></div>`);
|
||||
});
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user