Skip to content

Commit

Permalink
Only hide the control
Browse files Browse the repository at this point in the history
  • Loading branch information
ellatrix committed Jun 24, 2024
1 parent 043a65f commit 3105da8
Showing 1 changed file with 13 additions and 14 deletions.
27 changes: 13 additions & 14 deletions packages/block-library/src/image/image.js
Original file line number Diff line number Diff line change
Expand Up @@ -967,20 +967,19 @@ export default function Image( {
<>
{ controls }
{ img }
{ /* Don't add caption component and controls in images with pattern overrides */ }
{ ! arePatternOverridesEnabled && (
<Caption
attributes={ attributes }
setAttributes={ setAttributes }
isSelected={ isSingleSelected }
insertBlocksAfter={ insertBlocksAfter }
label={ __( 'Image caption text' ) }
showToolbarButton={
isSingleSelected && hasNonContentControls
}
readOnly={ lockCaption }
/>
) }
<Caption
attributes={ attributes }
setAttributes={ setAttributes }
isSelected={ isSingleSelected }
insertBlocksAfter={ insertBlocksAfter }
label={ __( 'Image caption text' ) }
showToolbarButton={
isSingleSelected &&
hasNonContentControls &&
! arePatternOverridesEnabled
}
readOnly={ lockCaption }
/>
</>
);
}

0 comments on commit 3105da8

Please sign in to comment.