diff --git a/addons/web_editor/static/lib/odoo-editor/src/OdooEditor.js b/addons/web_editor/static/lib/odoo-editor/src/OdooEditor.js index 4e5b32abb67..77e8ff0c6b6 100644 --- a/addons/web_editor/static/lib/odoo-editor/src/OdooEditor.js +++ b/addons/web_editor/static/lib/odoo-editor/src/OdooEditor.js @@ -153,6 +153,7 @@ export class OdooEditor extends EventTarget { return closestElement(selection.anchorNode, 'P, DIV'); } }, + isHintBlacklisted: () => false, _t: string => string, }, options, @@ -1825,7 +1826,9 @@ export class OdooEditor extends EventTarget { for (const [selector, text] of Object.entries(selectors)) { for (const el of this.editable.querySelectorAll(selector)) { - this._makeHint(el, text); + if (!this.options.isHintBlacklisted(el)) { + this._makeHint(el, text); + } } } diff --git a/addons/web_editor/static/src/js/wysiwyg/wysiwyg.js b/addons/web_editor/static/src/js/wysiwyg/wysiwyg.js index 8cb0caee5fb..2cd791d00d7 100644 --- a/addons/web_editor/static/src/js/wysiwyg/wysiwyg.js +++ b/addons/web_editor/static/src/js/wysiwyg/wysiwyg.js @@ -88,6 +88,10 @@ const Wysiwyg = Widget.extend({ return !(node.hasAttribute && node.hasAttribute('data-oe-model')) && node; } }, + isHintBlacklisted: node => { + return node.hasAttribute && + (node.hasAttribute('data-target') || node.hasAttribute('data-oe-model')); + }, noScrollSelector: 'body, .note-editable, .o_content, #wrapwrap', commands: commands, });