diff options
| author | Sébastien Theys <seb@odoo.com> | 2020-09-23 09:24:56 +0000 |
|---|---|---|
| committer | Sébastien Theys <seb@odoo.com> | 2020-09-23 17:08:27 +0000 |
| commit | 31d4332e25cf39ac0f1278a60651f34d18904875 (patch) | |
| tree | 0f136cb64ac68060a24a2b4fb853308abe658a02 /addons/web/static/src | |
| parent | db208c76f7de734fdcaf977412137bd9ea0d82ac (diff) | |
[FIX] web, mail: recompute popover on content change
Because the position of the popover depends on the size of its content.
Part of task-2270731
X-original-commit: 3066a946ef1ca0973503207d0486515798168fa2
Diffstat (limited to 'addons/web/static/src')
| -rw-r--r-- | addons/web/static/src/js/core/popover.js | 10 | ||||
| -rw-r--r-- | addons/web/static/src/xml/base.xml | 2 |
2 files changed, 11 insertions, 1 deletions
diff --git a/addons/web/static/src/js/core/popover.js b/addons/web/static/src/js/core/popover.js index 53e5b960e9c..28843d55d47 100644 --- a/addons/web/static/src/js/core/popover.js +++ b/addons/web/static/src/js/core/popover.js @@ -195,6 +195,16 @@ odoo.define('web.Popover', function () { } /** + * Popover must recompute its position when children content changes. + * + * @private + * @param {Event} ev + */ + _onPopoverCompute(ev) { + this._compute(); + } + + /** * A resize event will need to 'reposition' the popover close to its * target. * diff --git a/addons/web/static/src/xml/base.xml b/addons/web/static/src/xml/base.xml index 25426728326..ada9472d7ed 100644 --- a/addons/web/static/src/xml/base.xml +++ b/addons/web/static/src/xml/base.xml @@ -496,7 +496,7 @@ </t> <t t-name="Popover" owl="1"> - <div t-att-class="{ 'o_is_open': state.displayed }" t-on-click="_onClick" t-on-o-popover-close="_onPopoverClose"> + <div t-att-class="{ 'o_is_open': state.displayed }" t-on-click="_onClick" t-on-o-popover-compute="_onPopoverCompute" t-on-o-popover-close="_onPopoverClose"> <t t-slot="default"/> <Portal t-if="state.displayed" target="'body'"> <div role="tooltip" class="o_popover" t-ref="popover"> |
