summaryrefslogtreecommitdiff
path: root/addons/web/static/src/js/owl_compatibility.js
diff options
context:
space:
mode:
authorMichael Mattiello (mcm) <mcm@odoo.com>2020-10-19 10:58:34 +0000
committerMichael Mattiello (mcm) <mcm@odoo.com>2020-10-22 10:39:49 +0000
commit1ac67480ba995efbb2fb6f15d261c14c6828de76 (patch)
tree98f279588ddf4ec976a961804374a65db812accf /addons/web/static/src/js/owl_compatibility.js
parentb765ecf908b998773c9c2167f663580792069758 (diff)
[FIX] web: keep new widget el in ComponentAdapter
Before this commit, when sub widget replaced its el, the ComponentAdapter parent kept the previous el. This caused some issues as in the ActivityRecordAdapter which lost its event listeners when re-rendered. This commit forces the ComponentAdapter to keep the new sub widget el after being patched. task id: 2360021 closes odoo/odoo#60517 X-original-commit: 393b5fd4cfba254ad054a526996e82922f9057e2 Signed-off-by: Aaron Bohy (aab) <aab@odoo.com> Signed-off-by: Michaƫl Mattiello <mcm-odoo@users.noreply.github.com>
Diffstat (limited to 'addons/web/static/src/js/owl_compatibility.js')
-rw-r--r--addons/web/static/src/js/owl_compatibility.js6
1 files changed, 5 insertions, 1 deletions
diff --git a/addons/web/static/src/js/owl_compatibility.js b/addons/web/static/src/js/owl_compatibility.js
index b5ff2a026d1..a33f5ebed58 100644
--- a/addons/web/static/src/js/owl_compatibility.js
+++ b/addons/web/static/src/js/owl_compatibility.js
@@ -142,7 +142,11 @@ odoo.define('web.OwlCompatibility', function () {
}
vnode.elm = this.widget.el;
}
- return super.__patch(...arguments);
+ const result = super.__patch(...arguments);
+ if (this.widget && this.el !== this.widget.el) {
+ this.__owl__.vnode.elm = this.widget.el;
+ }
+ return result;
}
/**