Skip to content

Commit

Permalink
Fix: Impossible to drag & drop blocks if locking is insert (#14521)
Browse files Browse the repository at this point in the history
If the CPT locking is set to insert it should be possible to move the blocks. Currently, it is possible to move the blocks using the block move buttons but not possible using drag & drop.
  • Loading branch information
jorgefilipecosta committed May 7, 2019
1 parent b2ad325 commit 1385adf
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
6 changes: 3 additions & 3 deletions packages/block-editor/src/components/block-drop-zone/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -111,8 +111,8 @@ class BlockDropZone extends Component {
}

render() {
const { isLocked, index } = this.props;
if ( isLocked ) {
const { isLockedAll, index } = this.props;
if ( isLockedAll ) {
return null;
}
const isAppender = index === undefined;
Expand Down Expand Up @@ -158,7 +158,7 @@ export default compose(
withSelect( ( select, { rootClientId } ) => {
const { getClientIdsOfDescendants, getTemplateLock, getBlockIndex } = select( 'core/block-editor' );
return {
isLocked: !! getTemplateLock( rootClientId ),
isLockedAll: getTemplateLock( rootClientId ) === 'all',
getClientIdsOfDescendants,
getBlockIndex,
};
Expand Down
2 changes: 1 addition & 1 deletion packages/block-editor/src/store/actions.js
Original file line number Diff line number Diff line change
Expand Up @@ -298,7 +298,7 @@ export const moveBlocksUp = createOnMove( 'MOVE_BLOCKS_UP' );
*
* @yields {Object} Action object.
*/
export function* moveBlockToPosition( clientId, fromRootClientId, toRootClientId, index ) {
export function* moveBlockToPosition( clientId, fromRootClientId = '', toRootClientId = '', index ) {
const templateLock = yield select(
'core/block-editor',
'getTemplateLock',
Expand Down

0 comments on commit 1385adf

Please sign in to comment.