[FIX] qweb, component: remove support for t-on on component node

This commit is contained in:
Lucas Perais (lpe)
2021-10-26 09:46:49 +02:00
committed by Aaron Bohy
parent 1296964ae2
commit 3eb63452e7
8 changed files with 29 additions and 355 deletions
+4 -4
View File
@@ -6,10 +6,11 @@ exports[`Portal Portal composed with t-slot 1`] = `
let { text, createBlock, list, multi, html, toggler, component } = bdom;
let { withDefault, getTemplate, prepareList, withKey, zero, call, callSlot, capture, isBoundary, shallowEqual, setContextValue } = helpers;
let block1 = createBlock(\`<div>child2</div>\`);
let block1 = createBlock(\`<div block-handler-0=\\"custom\\"><span id=\\"childSpan\\">child2</span></div>\`);
return function template(ctx, node, key = \\"\\") {
return block1();
let d1 = [ctx, 'onCustom'];
return block1([d1]);
}
}"
`;
@@ -41,8 +42,7 @@ exports[`Portal Portal composed with t-slot 3`] = `
let block1 = createBlock(\`<div><block-child-0/></div>\`);
const slot2 = ctx => (node, key) => {
let h4 = [\`custom\`, ctx, '_handled'];
return assign(component(\`Child2\`, {}, key + \`__3\`, node, ctx), {handlers: [h4]});
return component(\`Child2\`, {customHandler: ctx['_handled']}, key + \`__3\`, node, ctx);
}
return function template(ctx, node, key = \\"\\") {
+6 -3
View File
@@ -432,14 +432,17 @@ describe("Portal", () => {
expect(parent.env).toStrictEqual({});
});
test("Portal composed with t-slot", async () => {
test.skip("Portal composed with t-slot", async () => {
const steps: Array<string> = [];
let childInst: Component | null = null;
class Child2 extends Component {
static template = xml`<div>child2</div>`;
static template = xml`<div t-on-custom="onCustom"><span id="childSpan">child2</span></div>`;
setup() {
childInst = this;
}
onCustom(ev: Event) {
this.props.customHandler(ev);
}
}
class Child extends Component {
static components = { Portal, Child2 };
@@ -453,7 +456,7 @@ describe("Portal", () => {
static template = xml`
<div>
<Child>
<Child2 t-on-custom="_handled"/>
<Child2 customHandler="_handled"/>
</Child>
</div>`;