mirror of
https://github.com/odoo/owl.git
synced 2025-10-06 19:59:41 +07:00
[FIX] qweb: properly remove t-ref reference
when the node is removed from the dom
This commit is contained in:
@@ -93,6 +93,7 @@ QWeb.addDirective({
|
||||
const refKey = `ref${ctx.generateID()}`;
|
||||
ctx.addLine(`const ${refKey} = ${ctx.interpolate(value)};`);
|
||||
addNodeHook("create", `context.__owl__.refs[${refKey}] = n.elm;`);
|
||||
addNodeHook("destroy", `delete context.__owl__.refs[${refKey}];`);
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
+2
-1
@@ -69,7 +69,8 @@ const whitespaceRE = /\s+/g;
|
||||
const NODE_HOOKS_PARAMS = {
|
||||
create: "(_, n)",
|
||||
insert: "vn",
|
||||
remove: "(vn, rm)"
|
||||
remove: "(vn, rm)",
|
||||
destroy: "()"
|
||||
};
|
||||
|
||||
interface Utils {
|
||||
|
||||
Reference in New Issue
Block a user