mirror of
https://github.com/odoo/owl.git
synced 2025-10-06 19:59:41 +07:00
[FIX] properly get component reference instead of context
Before this commit, the generated code for the component directive was using the current context as the place to look for static informations (such as the sub components). However, it is not entirely correct, since the current context may be different than the current component (which is easily accessed by using the this variable). Also, while doing this, we fix some issues in the t-set directive, which as calling lazy values with the wrong this.
This commit is contained in:
@@ -38,7 +38,7 @@ exports[`event handling handler receive the event as argument 1`] = `
|
||||
|
||||
return function template(ctx, node, key = \\"\\") {
|
||||
let hdlr1 = [ctx['inc'], ctx];
|
||||
const b2 = comp1({}, key + \`__1\`, node, ctx, null);
|
||||
const b2 = comp1({}, key + \`__1\`, node, this, null);
|
||||
let txt1 = ctx['state'].value;
|
||||
return block1([hdlr1, txt1], [b2]);
|
||||
}
|
||||
@@ -69,7 +69,7 @@ exports[`event handling input blur event is not called if component is destroyed
|
||||
return function template(ctx, node, key = \\"\\") {
|
||||
let b2;
|
||||
if (ctx['state'].cond) {
|
||||
b2 = comp1({}, key + \`__1\`, node, ctx, null);
|
||||
b2 = comp1({}, key + \`__1\`, node, this, null);
|
||||
}
|
||||
return block1([], [b2]);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user