Skip to content

Commit

Permalink
Fix selector import (#10330)
Browse files Browse the repository at this point in the history
  • Loading branch information
nosolosw authored Oct 4, 2018
1 parent 4a47dff commit 0332aa9
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions packages/editor/src/components/block-drop-zone/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ class BlockDropZone extends Component {
}

onDrop( event, position ) {
const { rootClientId: dstRootClientId, clientId: dstClientId, index: dstIndex, getDescendants } = this.props;
const { rootClientId: dstRootClientId, clientId: dstClientId, index: dstIndex, getClientIdsOfDescendants } = this.props;
const { srcRootClientId, srcClientId, srcIndex, type } = parseDropEvent( event );

const isBlockDropType = ( dropType ) => dropType === 'block';
Expand All @@ -87,7 +87,7 @@ class BlockDropZone extends Component {
return ( srcRoot === dstRoot ) || ( ! srcRoot === true && ! dstRoot === true );
};
const isSameBlock = ( src, dst ) => src === dst;
const isSrcBlockAnAncestorOfDstBlock = ( src, dst ) => getDescendants( [ src ] ).some( ( id ) => id === dst );
const isSrcBlockAnAncestorOfDstBlock = ( src, dst ) => getClientIdsOfDescendants( [ src ] ).some( ( id ) => id === dst );

if ( ! isBlockDropType( type ) ||
isSameBlock( srcClientId, dstClientId ) ||
Expand Down Expand Up @@ -156,10 +156,10 @@ export default compose(
};
} ),
withSelect( ( select, { rootClientId } ) => {
const { getDescendants, getTemplateLock } = select( 'core/editor' );
const { getClientIdsOfDescendants, getTemplateLock } = select( 'core/editor' );
return {
isLocked: !! getTemplateLock( rootClientId ),
getDescendants,
getClientIdsOfDescendants,
};
} )
)( BlockDropZone );

0 comments on commit 0332aa9

Please sign in to comment.