From aeb4b57f8537156dea60a985529946d3d6ea16fe Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20Geelen=20=28sge=29?= Date: Wed, 26 Oct 2022 12:13:33 +0000 Subject: [PATCH] [FIX] web_editor: dynamic placeholder bug MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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) Signed-off-by: Geelen Sébastien (sge) --- addons/web_editor/static/src/js/backend/html_field.js | 3 +++ 1 file changed, 3 insertions(+) diff --git a/addons/web_editor/static/src/js/backend/html_field.js b/addons/web_editor/static/src/js/backend/html_field.js index 0b2a0648fb6..7d4356d06aa 100644 --- a/addons/web_editor/static/src/js/backend/html_field.js +++ b/addons/web_editor/static/src/js/backend/html_field.js @@ -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(); }