Explorar el Código

Fixed order of firing _change event and resetting differ.

Maciej Bukowski hace 7 años
padre
commit
0f1f207a1d
Se han modificado 1 ficheros con 3 adiciones y 2 borrados
  1. 3 2
      packages/ckeditor5-engine/src/model/model.js

+ 3 - 2
packages/ckeditor5-engine/src/model/model.js

@@ -699,10 +699,11 @@ export default class Model {
 			// Collect an information whether the model document has changed during from the last pending change callback.
 			// Collect an information whether the model document has changed during from the last pending change callback.
 			hasModelDocumentChanged = hasModelDocumentChanged || this.document._hasDocumentChangedFromTheLastChangeBlock();
 			hasModelDocumentChanged = hasModelDocumentChanged || this.document._hasDocumentChangedFromTheLastChangeBlock();
 
 
-			this.document._runPostFixersAndResetDiffer( this._currentWriter );
-
+			// Fire '_change' event before resetting differ.
 			this.fire( '_change', this._currentWriter );
 			this.fire( '_change', this._currentWriter );
 
 
+			this.document._runPostFixersAndResetDiffer( this._currentWriter );
+
 			this._pendingChanges.shift();
 			this._pendingChanges.shift();
 			this._currentWriter = null;
 			this._currentWriter = null;
 		}
 		}