diff --git a/addons/web_editor/static/src/js/editor/odoo-editor/src/utils/utils.js b/addons/web_editor/static/src/js/editor/odoo-editor/src/utils/utils.js index 64af7c5f6e0..1a0fb45673d 100644 --- a/addons/web_editor/static/src/js/editor/odoo-editor/src/utils/utils.js +++ b/addons/web_editor/static/src/js/editor/odoo-editor/src/utils/utils.js @@ -858,7 +858,7 @@ export function getDeepestPosition(node, offset) { let direction = DIRECTIONS.RIGHT; let next = node; while (next) { - if (isVisible(next) || isZWS(next)) { + if ((isVisible(next) || isZWS(next)) && (!isBlock(next) || next.isContentEditable)) { // Valid node: update position then try to go deeper. if (next !== node) { [node, offset] = [next, direction ? 0 : nodeSize(next)]; diff --git a/addons/web_editor/static/tests/banner_tests.js b/addons/web_editor/static/tests/banner_tests.js index d1e1bb21c8c..ec90bef2252 100644 --- a/addons/web_editor/static/tests/banner_tests.js +++ b/addons/web_editor/static/tests/banner_tests.js @@ -126,6 +126,31 @@ QUnit.module(