[FIX] qweb/component: do not call handlers for unmounted components

Unmounted components should be considered inactive, at least from the
perspective of Owl itself.

closes #543
This commit is contained in:
Géry Debongnie
2019-12-04 21:29:34 +01:00
committed by aab-odoo
parent b67cb71048
commit a0bfbf6dd0
8 changed files with 141 additions and 42 deletions
+1 -1
View File
@@ -298,7 +298,7 @@ QWeb.addDirective({
params = `owner, ${ctx.formatExpression(extraArgs)}`;
}
}
let handler = `function (e) {`;
let handler = `function (e) {if(!owner.__owl__.isMounted){return}`;
handler += mods
.map(function(mod) {
return T_COMPONENT_MODS_CODE[mod];
+1 -1
View File
@@ -41,7 +41,7 @@ QWeb.addDirective({
return "";
});
let params = extraArgs ? `owner, ${ctx.formatExpression(extraArgs)}` : "owner";
let handler = `function (e) {`;
let handler = `function (e) {if (!context.__owl__.isMounted){return}`;
handler += mods
.map(function(mod) {
return MODS_CODE[mod];