Skip to content

Commit

Permalink
Only handle rename UI if selected
Browse files Browse the repository at this point in the history
  • Loading branch information
getdave committed Oct 11, 2023
1 parent 869f7b2 commit aa166ab
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions packages/block-editor/src/hooks/block-rename-ui.js
Original file line number Diff line number Diff line change
Expand Up @@ -189,13 +189,13 @@ function BlockRenameControl( props ) {

export const withBlockRenameControl = createHigherOrderComponent(
( BlockEdit ) => ( props ) => {
const { clientId, name, attributes, setAttributes } = props;
const { clientId, name, attributes, setAttributes, isSelected } = props;

const supportsBlockNaming = hasBlockSupport( name, 'renaming', true );

return (
<>
{ supportsBlockNaming && (
{ isSelected && supportsBlockNaming && (
<>
<BlockRenameControl
clientId={ clientId }
Expand Down

0 comments on commit aa166ab

Please sign in to comment.