diff --git a/addons/web_editor/static/src/js/wysiwyg/wysiwyg.js b/addons/web_editor/static/src/js/wysiwyg/wysiwyg.js index 061716a84e7..8b3566a7484 100644 --- a/addons/web_editor/static/src/js/wysiwyg/wysiwyg.js +++ b/addons/web_editor/static/src/js/wysiwyg/wysiwyg.js @@ -1319,7 +1319,7 @@ const Wysiwyg = Widget.extend({ // Open the link tool when CTRL+K is pressed. if (e && e.key === 'k' && (e.ctrlKey || e.metaKey)) { e.preventDefault(); - const targetEl = this.odooEditor.document.getSelection().baseNode; // FIXME this is undefined on Firefox after clicking on an image and hitting CTRL-K + 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 && (targetEl.tagName === 'IMG' || targetEl.querySelectorAll('img').length === 1)) {