diff --git a/addons/web_editor/static/src/js/editor/odoo-editor/src/OdooEditor.js b/addons/web_editor/static/src/js/editor/odoo-editor/src/OdooEditor.js index 4ec9cca67e5..46b68b60bda 100644 --- a/addons/web_editor/static/src/js/editor/odoo-editor/src/OdooEditor.js +++ b/addons/web_editor/static/src/js/editor/odoo-editor/src/OdooEditor.js @@ -4294,7 +4294,11 @@ export class OdooEditor extends EventTarget { selection.anchorNode === container && selection.focusNode === container && selection.anchorOffset === 0 && - selection.focusOffset === [...container.childNodes].length + selection.focusOffset === [...container.childNodes].length && + // Checks that the container is not an empty editable structure to + // avoid calling "getDeepRange" if it is, otherwise it will be + // selected again, creating an infine loop. + container.childNodes.length ) { getDeepRange(container, {select: true}); // The selection is changed in `getDeepRange` and will therefore