[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
This commit is contained in:
@@ -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");
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user