diff --git a/app/javascript/editor/editor.js b/app/javascript/editor/editor.js index a52f9c8e..75749623 100644 --- a/app/javascript/editor/editor.js +++ b/app/javascript/editor/editor.js @@ -275,7 +275,8 @@ const cleanContent = (contentEl) => { contentEl.insertBefore(el, child.nextSibling) el.appendChild(child) - sel.collapse(el, el.textContent.length) + sel.selectAllChildren(contentEl) + sel.collapseToEnd() } } }