diff --git a/src/mixin.js b/src/mixin.js index dde09f17..45629153 100644 --- a/src/mixin.js +++ b/src/mixin.js @@ -45,8 +45,15 @@ var QuillMixin = { } }.bind(this); - editor.on('text-change', this.handleTextChange); - editor.on('selection-change', this.handleSelectionChange); + editor.on('editor-change', function(eventType, rangeOrDelta, oldRangeOrOldDelta, source) { + if (eventType === Quill.events.SELECTION_CHANGE) { + this.handleSelectionChange(rangeOrDelta, oldRangeOrOldDelta, source); + } + + if (eventType === Quill.events.TEXT_CHANGE) { + this.handleTextChange(rangeOrDelta, oldRangeOrOldDelta, source); + } + }.bind(this)); }, unhookEditor: function(editor) {