Skip to content

Commit

Permalink
Add hasChildSelected prop
Browse files Browse the repository at this point in the history
  • Loading branch information
gziolo committed May 16, 2019
1 parent 5096ee9 commit a3e9dbd
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion packages/block-editor/src/components/block-list/block.js
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,7 @@ const preventDrag = ( event ) => {

function BlockListBlock( {
blockRef,
hasChildSelected,
mode,
isFocusMode,
hasFixedToolbar,
Expand Down Expand Up @@ -382,6 +383,7 @@ function BlockListBlock( {
const wrapperClassName = classnames(
'wp-block editor-block-list__block block-editor-block-list__block',
{
'has-child-selected': hasChildSelected,
'has-warning': ! isValid || !! hasError || isUnregisteredBlock,
'is-selected': shouldAppearSelected,
'is-multi-selected': isPartOfMultiSelection,
Expand All @@ -392,7 +394,6 @@ function BlockListBlock( {
'is-focused':
isFocusMode && ( isSelected || isParentOfSelectedBlock ),
'is-focus-mode': isFocusMode,
'has-child-selected': isParentOfSelectedBlock,
},
className
);
Expand Down Expand Up @@ -595,6 +596,7 @@ const applyWithSelect = withSelect(
const { name, attributes, isValid } = block || {};

return {
hasChildSelected: hasSelectedInnerBlock( clientId ),
isPartOfMultiSelection:
isBlockMultiSelected( clientId ) || isAncestorMultiSelected( clientId ),
isFirstMultiSelected: isFirstMultiSelectedBlock( clientId ),
Expand Down

0 comments on commit a3e9dbd

Please sign in to comment.