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 15d83d2c177590513271ebf108294c93e718645a
parent b9a7548f96dcc0dfd2f6c0a08d33745873a066a1
Author: Henry Unite <unitehenry@gmail.com>
Date:   Wed, 23 Sep 2020 15:42:44 -0400

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

Diffstat:
Msrc/striveneditor.js | 18+++++++++++++++++-
1 file changed, 17 insertions(+), 1 deletion(-)

diff --git a/src/striveneditor.js b/src/striveneditor.js @@ -1120,8 +1120,24 @@ export default class StrivenEditor { !se.browser.isEdge() && se.setRange(); window.addEventListener('mouseup', execRange); - + se.editor.classList.add('se-focus'); + + if(se.body.textContent.trim() === '') { + const r = se.getRange(); + + if(r) { + const selNode = document.createTextNode(''); + se.body.append(selNode); + + setTimeout(() => { + se.getRange().selectNode(selNode); + selNode.remove(); + }, 0); + + } + + } if (se.scrollPosition && !se.browser.isEdge()) { body.scrollTo(se.scrollPosition);