[FIX] web_editor: dynamic placeholder bug

The dynamic placeholder result was not added in the
editable dom in some situation. When the editor was
in rollback mode `true` after a `commitChange`
( maybe because of a `_toInline` called) the result
of the dynamic placeholder was rollback.

task-3044924

closes odoo/odoo#104343

X-original-commit: e9bd4f020ff4a5dd4240fde9caef0bded9a2e28c
Signed-off-by: David Monjoie (dmo) <dmo@odoo.com>
Signed-off-by: Geelen Sébastien (sge) <sge@odoo.com>
This commit is contained in:
Sébastien Geelen (sge)
2022-10-28 09:17:40 +02:00
parent 01eb39194f
commit aeb4b57f85
@@ -354,10 +354,13 @@ export class HtmlField extends Component {
async commitChanges({ urgent } = {}) {
if (this._isDirty() || urgent) {
if (this.wysiwyg) {
// Avoid listening to changes made during the _toInline process.
this.wysiwyg.odooEditor.observerUnactive('commitChanges');
await this.wysiwyg.saveModifiedImages();
if (this.props.isInlineStyle) {
await this._toInline();
}
this.wysiwyg.odooEditor.observerActive('commitChanges');
}
await this.updateValue();
}