Procházet zdrojové kódy

Fixed: MoveOperation thrown errors when it should not (fixes #413).

Szymon Cofalik před 9 roky
rodič
revize
70b22962f4

+ 1 - 1
packages/ckeditor5-engine/src/treemodel/operation/moveoperation.js

@@ -139,7 +139,7 @@ export default class MoveOperation extends Operation {
 			throw new CKEditorError(
 				'operation-move-range-into-itself: Trying to move a range of nodes to the inside of that range.'
 			);
-		} else {
+		} else if ( this.sourcePosition.root == this.targetPosition.root ) {
 			if ( compareArrays( this.sourcePosition.getParentPath(), this.targetPosition.getParentPath() ) == 'PREFIX' ) {
 				let i = this.sourcePosition.path.length - 1;