Skip to content

Commit

Permalink
Fix move block to position bug; Add test cases.
Browse files Browse the repository at this point in the history
  • Loading branch information
jorgefilipecosta committed Apr 30, 2019
1 parent c1ba13e commit e0490b8
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions packages/block-editor/src/store/actions.js
Original file line number Diff line number Diff line change
Expand Up @@ -324,6 +324,12 @@ export function* moveBlockToPosition( clientId, fromRootClientId, toRootClientId
return;
}

// If templateLock is insert we can not remove the block from the parent.
// Given that here we know that we are moving the block to a different parent, the move should not be possible if the condition is true.
if ( templateLock === 'insert' ) {
return;
}

const blockName = yield select(
'core/block-editor',
'getBlockName',
Expand Down

0 comments on commit e0490b8

Please sign in to comment.