8
0
Szymon Cofalik 9 лет назад
Родитель
Сommit
bd0cd9190e
1 измененных файлов с 3 добавлено и 1 удалено
  1. 3 1
      packages/ckeditor5-engine/src/model/operation/removeoperation.js

+ 3 - 1
packages/ckeditor5-engine/src/model/operation/removeoperation.js

@@ -122,7 +122,9 @@ export default class RemoveOperation extends MoveOperation {
 
 			graveyard.insertChildren( this._holderElementOffset, holderElement );
 
-			// Fix source position if we just inserted something before it.
+			// If the operation removes nodes that are already in graveyard, it may happen that
+			// the operation's source position is invalidated by inserting new holder element into the graveyard.
+			// If that's the case, we need to fix source position path.
 			if ( this.sourcePosition.root == graveyard && this.sourcePosition.path[ 0 ] >= this._holderElementOffset ) {
 				this.sourcePosition.path[ 0 ]++;
 			}