striven-editor

Maintained and contributed to an open source WYSIWYG editor as an internship project that made it to production and was adopted by the company I was working at.
git clone https://unitehenry.com/git/striven-editor.git
Log | Files | Refs | README | LICENSE

commit f8e23eee6fc1e889743463b6971bc731b67311bf
parent d12cf7e9de606ab7f780b76f2695acf400c8c3ad
Author: Henry Unite <unitehenry@gmail.com>
Date:   Wed, 23 Sep 2020 16:31:39 -0400

Merge branch 'dev' of https://github.com/striven-erp/striven-editor

Diffstat:
Msrc/striveneditor.js | 11+++++++++--
1 file changed, 9 insertions(+), 2 deletions(-)

diff --git a/src/striveneditor.js b/src/striveneditor.js @@ -1122,7 +1122,7 @@ export default class StrivenEditor { window.addEventListener('mouseup', execRange); se.editor.classList.add('se-focus'); - + if(se.body.textContent.trim() === '') { const r = se.getRange(); @@ -1135,8 +1135,15 @@ export default class StrivenEditor { selNode.remove(); }, 0); - } + } + } else { + const r = se.getRange(); + + if(r) { + r.selectNodeContents(se.body); + r.collapse(); + } } if (se.scrollPosition && !se.browser.isEdge()) {