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 20213552d9069f414154302034ab3bf928622d04
parent aeffed9f6bfdb3525d76b4082647377bcd00ed06
Author: unitehenry <unitehenry@gmail.com>
Date:   Thu, 19 Mar 2020 11:09:48 -0400

edge scrollTo bug

Diffstat:
Mpackage.json | 2+-
Msrc/striveneditor.js | 16+++++++++++-----
2 files changed, 12 insertions(+), 6 deletions(-)

diff --git a/package.json b/package.json @@ -1,7 +1,7 @@ { "name": "@striven-erp/striven-editor", "private": false, - "version": "3.1.4", + "version": "3.1.5", "description": "The lightweight zero-dependency Striven WYSIWYG editor.", "main": "./dist", "scripts": { diff --git a/src/striveneditor.js b/src/striveneditor.js @@ -34,9 +34,10 @@ export default class StrivenEditor { }); el.addEventListener('blur', function() { setTimeout(() => { - if (el.innerHTML != el.data_orig && (document.activeElement != se.body)) se.options.change(se.getContent()); + if (el.innerHTML != el.data_orig && document.activeElement != se.body) + se.options.change(se.getContent()); delete el.data_orig; - }, 100); + }, 100); }); } @@ -506,8 +507,9 @@ export default class StrivenEditor { se.body.onfocus = () => { se.body.textContent && se.setRange(se.range); se.execFontStates(); - se.scrollPosition && + if (se.scrollPosition && !se.browser.isEdge()) { se.body.scrollTo(se.scrollPosition.x, se.scrollPosition.y); + } se.body.onfocus = refocus; }; @@ -541,8 +543,9 @@ export default class StrivenEditor { se.body.onfocus = () => { se.body.textContent && se.setRange(se.range); se.execFontStates(); - se.scrollPosition && + if (se.scrollPosition && !se.browser.isEdge()) { se.body.scrollTo(se.scrollPosition.x, se.scrollPosition.y); + } se.body.onfocus = refocus; }; @@ -940,7 +943,10 @@ export default class StrivenEditor { this.execFontStates(); this.editor.classList.add('se-focus'); - this.scrollPosition && body.scrollTo(this.scrollPosition); + + if(this.scrollPosition && !this.browser.isEdge()) { + body.scrollTo(this.scrollPosition); + } bodyFocus && bodyFocus(); };