[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
@@ -10,7 +10,7 @@ exports[`Link component can render simple cases 1`] = `
var _6 = context['href'];
let c7 = [], p7 = {key:7,attrs:{href: _6},class:_5,on:{}};
var vn7 = h('a', p7, c7);
extra.handlers['click' + 7] = extra.handlers['click' + 7] || function (e) {const fn = context['navigate'];if (fn) { fn.call(owner, e); } else { context.navigate; }};
extra.handlers['click' + 7] = extra.handlers['click' + 7] || function (e) {if (!context.__owl__.isMounted){return}const fn = context['navigate'];if (fn) { fn.call(owner, e); } else { context.navigate; }};
p7.on['click'] = extra.handlers['click' + 7];
const slot8 = this.constructor.slots[context.__owl__.slotId + '_' + 'default'];
if (slot8) {