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 26e279bfc71dd0784841fd615e518aa8a20abc59
parent cc7ef1034d29b05aeeb5bd1e182bd50e3bbcc367
Author: unitehenry <unitehenry@gmail.com>
Date:   Wed, 23 Sep 2020 16:31:19 -0400

tab editor with content

Diffstat:
Msrc/striveneditor.js | 10+++++-----
1 file changed, 5 insertions(+), 5 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,15 +1135,15 @@ export default class StrivenEditor { selNode.remove(); }, 0); - } else { + } + + } else { const r = se.getRange(); - if(se.body.textContent && r) { + if(r) { r.selectNodeContents(se.body); r.collapse(); } - } - } if (se.scrollPosition && !se.browser.isEdge()) {