From 98c1ebe9f09127d14c9fdb225872196a6f60fff0 Mon Sep 17 00:00:00 2001 From: Jorge Date: Tue, 19 Mar 2019 18:39:57 +0000 Subject: [PATCH] Fix: Impossible to drag & drop blocks if locking is insert --- .../block-editor/src/components/block-drop-zone/index.js | 6 +++--- packages/block-editor/src/store/actions.js | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/packages/block-editor/src/components/block-drop-zone/index.js b/packages/block-editor/src/components/block-drop-zone/index.js index fc71ee0a0c7d21..e0a0d1060ce4fe 100644 --- a/packages/block-editor/src/components/block-drop-zone/index.js +++ b/packages/block-editor/src/components/block-drop-zone/index.js @@ -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; @@ -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, }; diff --git a/packages/block-editor/src/store/actions.js b/packages/block-editor/src/store/actions.js index 6915280885ad42..42d866c04b21d5 100644 --- a/packages/block-editor/src/store/actions.js +++ b/packages/block-editor/src/store/actions.js @@ -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',