Skip to content

Commit

Permalink
Use moveBlockToPosition
Browse files Browse the repository at this point in the history
  • Loading branch information
ellatrix committed Apr 12, 2018
1 parent ef09336 commit 6662c36
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions editor/components/block-list/block.js
Original file line number Diff line number Diff line change
Expand Up @@ -641,6 +641,7 @@ const applyWithDispatch = withDispatch( ( dispatch, ownProps ) => {
replaceBlocks,
editPost,
toggleSelection,
moveBlockToPosition,
} = dispatch( 'core/editor' );
return {
onChange( uid, attributes ) {
Expand All @@ -663,8 +664,7 @@ const applyWithDispatch = withDispatch( ( dispatch, ownProps ) => {
isUnmodifiedDefaultBlock( first( blocks ) ) &&
isUnmodifiedDefaultBlock( block )
) {
removeBlock( block.uid );
insertBlocks( blocks, orderOfRoot + 1, rootUIDOfRoot );
moveBlockToPosition( block.uid, rootUID, rootUIDOfRoot, layout, orderOfRoot + 1 );
} else {
insertBlocks( blocks, order + 1, rootUID );
}
Expand Down

0 comments on commit 6662c36

Please sign in to comment.