Ckeditor5: Model: MoveOperation throws when it should not.

Created on 13 May 2016  路  2Comments  路  Source: ckeditor/ckeditor5

MoveOperation#execute should be changed to not throw when you move i.e. two nodes from graveyard [ 0 ] to root [ 1, 1 ]. Right now, MoveOperation does not count that these are different roots and thinks that this is wrong operation (because you try to move node 1 into itself).

} else {
            if ( compareArrays( this.sourcePosition.getParentPath(), this.targetPosition.getParentPath() ) == 'PREFIX' ) {

to

} else if ( this.sourcePosition.root == this.targetPosition.root ) {
            if ( compareArrays( this.sourcePosition.getParentPath(), this.targetPosition.getParentPath() ) == 'PREFIX' ) {
engine bug

Most helpful comment

I hate you.

All 2 comments

Don't forget about tests ;)

I hate you.

Was this page helpful?
0 / 5 - 0 ratings