[FIX] qweb: properly remove t-ref reference

when the node is removed from the dom
This commit is contained in:
Géry Debongnie
2019-10-10 17:08:16 +02:00
committed by aab-odoo
parent 1337aa0107
commit 4a346d0615
5 changed files with 36 additions and 1 deletions
+1
View File
@@ -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
View File
@@ -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 {