diff --git a/addons/web_editor/static/src/js/wysiwyg/plugin/keyboard.js b/addons/web_editor/static/src/js/wysiwyg/plugin/keyboard.js index 0cb451c100d..3ab6a5f0317 100644 --- a/addons/web_editor/static/src/js/wysiwyg/plugin/keyboard.js +++ b/addons/web_editor/static/src/js/wysiwyg/plugin/keyboard.js @@ -969,13 +969,13 @@ var KeyboardPlugin = AbstractPlugin.extend({ var pointA = this.context.invoke('HelperPlugin.makePoint', startNode, 0); pointA = dom.nextPointUntil(pointA, function (point) { return self.context.invoke('HelperPlugin.isVisibleText', point.node); - }); + }) || pointA; var endNode = $contents.length ? $contents[$contents.length - 1] : unbreakable; var endOffset = $contents.length ? dom.nodeLength($contents[$contents.length - 1]) : 1; var pointB = this.context.invoke('HelperPlugin.makePoint', endNode, endOffset); pointB = dom.prevPointUntil(pointB, function (point) { return self.context.invoke('HelperPlugin.isVisibleText', point.node); - }); + }) || pointB; range.sc = pointA.node; range.so = pointA.offset; range.ec = pointB.node;