[FIX] web_editor: command prompt not displaying on focus
Before this commit: command prompt is not displayed when html field has placeholder. After this commit: placeholder is replaced with command prompt when focused. Task-2881079 closes odoo/odoo#108175 X-original-commit: 16cb4af921fec5483e366ea0a1b402631a7e28f3 Signed-off-by: David Monjoie (dmo) <dmo@odoo.com>
This commit is contained in:
@@ -3829,7 +3829,8 @@ export class OdooEditor extends EventTarget {
|
||||
}
|
||||
|
||||
// placeholder hint
|
||||
if (this.editable.textContent === '' && this.options.placeholder && this.editable.firstChild && this.editable.firstChild.innerHTML) {
|
||||
const sel = this.document.getSelection();
|
||||
if (this.editable.textContent.trim() === '' && this.options.placeholder && this.editable.firstChild && this.editable.firstChild.innerHTML && !this.editable.contains(sel.focusNode)) {
|
||||
this._makeHint(this.editable.firstChild, this.options.placeholder, true);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user