[FIX] web_editor: prevent inline content on blur

Avoid inlining the content of html_field during blur
to ensure we don't break edition.

Blur occurred when opening dynamic placeholder popup or media modal.

If, during those process, we inline the document content,
the Editor will lose the reference to the current caret position inside the document.
Because Elements where overridden or changed by the `toInline` function.

If the editor cannot put the caret back in the previous correct position,
it will put it back at the end of the document.
And thus inserting the dynamicPlaceholder or new media element
at the wrong place inside the document.

task-3222474

X-original-commit: 28efe94a08d2747936ac4aa78f1d9e53545ee8b2
Part-of: odoo/odoo#124020
This commit is contained in:
Sébastien Geelen (sge)
2023-06-07 08:59:09 +02:00
parent 044f1b2db0
commit 57aaca7555
@@ -604,7 +604,10 @@ export class HtmlField extends Component {
}
}
_onWysiwygBlur() {
this.commitChanges();
// Avoid save on blur if the html field is in inline mode.
if (!this.props.isInlineStyle) {
this.commitChanges();
}
}
async _onReadonlyClickChecklist(ev) {
if (ev.offsetX > 0) {