ソースを参照

Merge pull request #625 from ckeditor/t/624

Fixed: LiveRange throwing after executing RenameOperation.
Szymon Cofalik 9 年 前
コミット
ac698c1a47
1 ファイル変更5 行追加1 行削除
  1. 5 1
      packages/ckeditor5-engine/src/model/liveposition.js

+ 5 - 1
packages/ckeditor5-engine/src/model/liveposition.js

@@ -123,12 +123,16 @@ export default class LivePosition extends Position {
  */
 function bindWithDocument() {
 	/*jshint validthis: true */
+	// Operation types handled by LivePosition (these are operations that change model tree structure).
+	const supportedTypes = new Set( [ 'insert', 'move', 'remove', 'reinsert' ] );
 
 	this.listenTo(
 		this.root.document,
 		'change',
 		( event, type, changes ) => {
-			transform.call( this, type, changes.range, changes.sourcePosition );
+			if ( supportedTypes.has( type ) ) {
+				transform.call( this, type, changes.range, changes.sourcePosition );
+			}
 		}
 	);
 }