diff --git a/addons/web_editor/static/src/js/wysiwyg/wysiwyg.js b/addons/web_editor/static/src/js/wysiwyg/wysiwyg.js index 6eca81e396f..071f2c871c5 100644 --- a/addons/web_editor/static/src/js/wysiwyg/wysiwyg.js +++ b/addons/web_editor/static/src/js/wysiwyg/wysiwyg.js @@ -1080,7 +1080,7 @@ const Wysiwyg = Widget.extend({ openLinkToolsFromSelection() { const targetEl = this.odooEditor.document.getSelection().getRangeAt(0).startContainer; // Link tool is different if the selection is an image or a text. - if (targetEl instanceof HTMLElement + if (targetEl.nodeType === Node.ELEMENT_NODE && (targetEl.tagName === 'IMG' || targetEl.querySelectorAll('img').length === 1)) { core.bus.trigger('activate_image_link_tool'); return;