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 884df6c65e1..9b396634681 100644 --- a/addons/web_editor/static/src/js/backend/html_field.js +++ b/addons/web_editor/static/src/js/backend/html_field.js @@ -337,7 +337,7 @@ export class HtmlField extends Component { this.wysiwyg.toolbar.$el.append($codeviewButtonToolbar); $codeviewButtonToolbar.click(this.toggleCodeView.bind(this)); } - this.wysiwyg.odooEditor.editable.addEventListener("input", () => + this.wysiwyg.odooEditor.editable.addEventListener("historyStep", () => this.props.record.model.bus.trigger("FIELD_IS_DIRTY", this._isDirty()) ); @@ -415,7 +415,7 @@ export class HtmlField extends Component { _isDirty() { const strippedPropValue = stripHistoryIds(String(this.props.record.data[this.props.name])); const strippedEditingValue = stripHistoryIds(this.getEditingValue()); - return !this.props.readonly && strippedPropValue !== strippedEditingValue; + return !this.props.readonly && (strippedPropValue || '