Skip to content

Commit

Permalink
Disable lightbox UI and add help text for linked images
Browse files Browse the repository at this point in the history
  • Loading branch information
artemiomorales committed Oct 6, 2023
1 parent c671843 commit f69033d
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions packages/block-library/src/image/image.js
Original file line number Diff line number Diff line change
Expand Up @@ -377,6 +377,8 @@ export default function Image( {
const lightboxChecked =
!! lightbox?.enabled || ( ! lightbox && !! lightboxSetting?.enabled );

const lightboxToggleDisabled = linkDestination !== 'none';

const dimensionsControl = (
<DimensionsTool
value={ { width, height, scale, aspectRatio } }
Expand Down Expand Up @@ -555,6 +557,14 @@ export default function Image( {
lightbox: { enabled: newValue },
} );
} }
disabled={ lightboxToggleDisabled }
help={
lightboxToggleDisabled
? __(
'Expand on Click is disabled for linked images.'
)
: ''
}
/>
</ToolsPanelItem>
) }
Expand Down

0 comments on commit f69033d

Please sign in to comment.