[FIX] web_editor: ensure _makeHint receives an element

Make a hint in the editor only if the first element is an element,
otherwise the method `_makeHint` would crash.

task-2898432

Part-of: odoo/odoo#94875
This commit is contained in:
Nicolas Bayet
2022-09-12 11:37:59 +02:00
parent e363c1d12d
commit 1d1e934db2
@@ -3372,7 +3372,7 @@ export class OdooEditor extends EventTarget {
}
// placeholder hint
if (this.editable.textContent === '' && this.options.placeholder) {
if (this.editable.textContent === '' && this.options.placeholder && this.editable.firstChild.innerHTML) {
this._makeHint(this.editable.firstChild, this.options.placeholder, true);
}
}