Skip to content
This repository has been archived by the owner on Mar 11, 2020. It is now read-only.

Fix to Support Grammarly Extension #70

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 10 additions & 1 deletion quillEditor.component.ts
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,16 @@ export class QuillEditorComponent implements AfterViewInit, ControlValueAccessor

// update model if text changes
this.quillEditor.on('text-change', (delta: any, oldDelta: any, source: any) => {
let html = this.editorElem.children[0].innerHTML;
let html: any = null;
if ('children' in this.editorElem) {
for (let i = 0; i < this.editorElem.children.length; i++) {
if ('className' in this.editorElem.children[i] && this.editorElem.children[i].className.indexOf('ql-editor') !== -1 && 'innerHTML' in this.editorElem.children[i]) {
html = this.editorElem.children[i].innerHTML;
break;
}
}
}

const text = this.quillEditor.getText();

if (html === '<p><br></p>') html = null;
Expand Down