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 b5d2b5f3f3014d29b0c38673628400e3a9828eff
parent 5dfbd964a84e9bda0b30b457dc1c4ffed7ba088d
Author: unitehenry <unitehenry@gmail.com>
Date:   Thu, 24 Sep 2020 11:16:37 -0400

check for body first child on textDec insert

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

diff --git a/src/striveneditor.js b/src/striveneditor.js @@ -2899,9 +2899,9 @@ export default class StrivenEditor { selNode.innerHTML = '&nbsp;'; b.append(selNode); - + const fc = se.body.firstChild; - fc ? fc.append(b) : se.body.append(b); + (fc && fc.append) ? fc.append(b) : se.body.append(b); r.selectNode(selNode); r.collapse();