From 1c6270ce97eb7aff2baf6fb4ed413a3491a5eef3 Mon Sep 17 00:00:00 2001 From: std-odoo Date: Thu, 29 Sep 2022 12:43:28 +0000 Subject: [PATCH] [FIX] web: fix the definition popover when we move the properties Bug === In knowledge, when we move for the first time a property, the popover position is wrong. The technical reason is that the component DOM is updated one time before the props changed, and so the DOM is not up to date when we compute the new position. Also, the popover might change it's relative position (top VS bottom) and so the small arrow might be incorrect in that case. Always remove it (rectangle popover better than a wrong arrow direction). Task-2980121 X-original-commit: de37a3393b31d48add36fc6be5febf70dc3db31e Part-of: odoo/odoo#102243 --- .../src/views/fields/properties/properties_field.js | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/addons/web/static/src/views/fields/properties/properties_field.js b/addons/web/static/src/views/fields/properties/properties_field.js index 16974e31d00..e24fa581f73 100644 --- a/addons/web/static/src/views/fields/properties/properties_field.js +++ b/addons/web/static/src/views/fields/properties/properties_field.js @@ -154,9 +154,10 @@ export class PropertiesField extends Component { propertiesValues[targetIndex] = propertiesValues[propertyIndex]; propertiesValues[propertyIndex] = prop; propertiesValues[propertyIndex].definition_changed = true; - this.props.update(propertiesValues); - // move the popover once the DOM is updated - this.shouldUpdatePopoverPosition = true; + this.props.update(propertiesValues).then(() => { + // move the popover once the DOM is updated + this.shouldUpdatePopoverPosition = true; + }); } /** @@ -320,6 +321,11 @@ export class PropertiesField extends Component { popover, { position: "top", margin: 10 }, ); + + const arrow = popover.querySelector(".popover-arrow"); + if (arrow) { + arrow.classList.add("d-none"); + } } /**