Skip to content

Commit

Permalink
Make the image Link URL field readonly. (WordPress#12190)
Browse files Browse the repository at this point in the history
  • Loading branch information
afercia authored Nov 22, 2018
1 parent cb0b899 commit 5653f10
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions packages/block-library/src/image/edit.js
Original file line number Diff line number Diff line change
Expand Up @@ -441,7 +441,7 @@ class ImageEdit extends Component {
} );

const isResizable = [ 'wide', 'full' ].indexOf( align ) === -1 && isLargeViewport;
const isLinkURLInputDisabled = linkDestination !== LINK_DESTINATION_CUSTOM;
const isLinkURLInputReadOnly = linkDestination !== LINK_DESTINATION_CUSTOM;

const getInspectorControls = ( imageWidth, imageHeight ) => (
<InspectorControls>
Expand Down Expand Up @@ -529,8 +529,8 @@ class ImageEdit extends Component {
label={ __( 'Link URL' ) }
value={ href || '' }
onChange={ this.onSetCustomHref }
placeholder={ ! isLinkURLInputDisabled ? 'https://' : undefined }
disabled={ isLinkURLInputDisabled }
placeholder={ ! isLinkURLInputReadOnly ? 'https://' : undefined }
readOnly={ isLinkURLInputReadOnly }
/>
<ToggleControl
label={ __( 'Open in New Tab' ) }
Expand Down

0 comments on commit 5653f10

Please sign in to comment.