Skip to content

Commit

Permalink
Fix selecting aligned blocks (#31904)
Browse files Browse the repository at this point in the history
  • Loading branch information
ellatrix authored May 19, 2021
1 parent 76d2e69 commit 5e0f3b9
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 3 deletions.
3 changes: 1 addition & 2 deletions packages/block-editor/src/components/block-list/block.js
Original file line number Diff line number Diff line change
Expand Up @@ -159,8 +159,7 @@ function BlockListBlock( {

const value = {
clientId,
// The wp-block className is important for editor styles.
className: classnames( className, { 'wp-block': ! isAligned } ),
className,
wrapperProps: omit( wrapperProps, [ 'data-align' ] ),
};
const memoizedValue = useMemo( () => value, Object.values( value ) );
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -138,6 +138,8 @@ export function useBlockProps( props = {}, { __unstableIsHtml } = {} ) {
'data-type': name,
'data-title': blockTitle,
className: classnames(
// The wp-block className is important for editor styles.
'wp-block block-editor-block-list__block',
className,
props.className,
wrapperProps.className,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ export function useBlockClassNames( clientId ) {
const activeEntityBlockId = getActiveBlockIdByBlockNames(
spotlightEntityBlocks
);
return classnames( 'block-editor-block-list__block', {
return classnames( {
'is-selected': isSelected,
'is-highlighted': isBlockHighlighted( clientId ),
'is-multi-selected': isBlockMultiSelected( clientId ),
Expand Down

0 comments on commit 5e0f3b9

Please sign in to comment.