diff --git a/addons/web_editor/static/src/js/editor/snippets.editor.js b/addons/web_editor/static/src/js/editor/snippets.editor.js index cdfdf1b4908..30b92a3184f 100644 --- a/addons/web_editor/static/src/js/editor/snippets.editor.js +++ b/addons/web_editor/static/src/js/editor/snippets.editor.js @@ -78,6 +78,9 @@ $.fn.extend({ return this; }, selectContent: function () { + if (this.length && !this[0].hasChildNodes()) { + return this.selectElement(); + } if (this.length) { const selection = document.getSelection(); selection.removeAllRanges();