Skip to content

Commit

Permalink
fix: need to type 2 characters before model is updated (issue KillerC…
Browse files Browse the repository at this point in the history
  • Loading branch information
Pierluca Borsò committed Feb 12, 2019
1 parent 8ce20c3 commit 8be2b2c
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/ng-quill.js
Original file line number Diff line number Diff line change
Expand Up @@ -147,7 +147,7 @@
}

this.$onChanges = function (changes) {
if (changes.ngModel && changes.ngModel.currentValue !== changes.ngModel.previousValue) {
if (changes.ngModel && changes.ngModel.currentValue && changes.ngModel.currentValue !== changes.ngModel.previousValue) {
content = changes.ngModel.currentValue

if (editor && !editorChanged) {
Expand All @@ -166,6 +166,9 @@
}
editorChanged = false
}
else if (editor && changes.ngModel && !changes.ngModel.currentValue) {
editor.setText('')
}

if (editor && changes.readOnly) {
editor.enable(!changes.readOnly.currentValue)
Expand Down

0 comments on commit 8be2b2c

Please sign in to comment.