Browse Source

Text watcher should listen to 'change:range' event only.

Maciej Gołaszewski 6 years ago
parent
commit
0ca0f3ec39
1 changed files with 2 additions and 2 deletions
  1. 2 2
      packages/ckeditor5-mention/src/textwatcher.js

+ 2 - 2
packages/ckeditor5-mention/src/textwatcher.js

@@ -52,8 +52,8 @@ export default class TextWatcher {
 	_startListening() {
 	_startListening() {
 		const editor = this.editor;
 		const editor = this.editor;
 
 
-		editor.model.document.selection.on( 'change', ( evt, { directChange } ) => {
-			// The indirect changes (ie on typing) are handled in document's change event.
+		editor.model.document.selection.on( 'change:range', ( evt, { directChange } ) => {
+			// The indirect changes (ie when user types or external changes are applied) are handled in document's change event.
 			if ( !directChange ) {
 			if ( !directChange ) {
 				return;
 				return;
 			}
 			}