Skip to content

Commit

Permalink
Image: Mark connected controls as 'readyonly' (#59059)
Browse files Browse the repository at this point in the history
* Image: Mark connected controls as 'readyonly'
* Update e2e tests

Co-authored-by: Mamaduka <[email protected]>
Co-authored-by: michalczaplinski <[email protected]>
Co-authored-by: afercia <[email protected]>
# Conflicts:
#	test/e2e/specs/editor/various/block-bindings.spec.js
  • Loading branch information
Mamaduka authored and getdave committed Feb 20, 2024
1 parent 245d24e commit 0a92dc2
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 8 deletions.
4 changes: 2 additions & 2 deletions packages/block-library/src/image/image.js
Original file line number Diff line number Diff line change
Expand Up @@ -634,7 +634,7 @@ export default function Image( {
label={ __( 'Alternative text' ) }
value={ alt || '' }
onChange={ updateAlt }
disabled={ lockAltControls }
readOnly={ lockAltControls }
help={
lockAltControls ? (
<>
Expand Down Expand Up @@ -676,7 +676,7 @@ export default function Image( {
label={ __( 'Title attribute' ) }
value={ title || '' }
onChange={ onSetTitle }
disabled={ lockTitleControls }
readOnly={ lockTitleControls }
help={
lockTitleControls ? (
<>{ __( 'Connected to a custom field' ) }</>
Expand Down
12 changes: 6 additions & 6 deletions test/e2e/specs/editor/various/block-bindings.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -565,7 +565,7 @@ test.describe( 'Block bindings', () => {
page
.getByRole( 'tabpanel', { name: 'Settings' } )
.getByLabel( 'Alternative text' )
).toBeDisabled();
).toHaveAttribute( 'readonly' );
const altValue = await page
.getByRole( 'tabpanel', { name: 'Settings' } )
.getByLabel( 'Alternative text' )
Expand Down Expand Up @@ -644,7 +644,7 @@ test.describe( 'Block bindings', () => {
page
.getByRole( 'tabpanel', { name: 'Settings' } )
.getByLabel( 'Title attribute' )
).toBeDisabled();
).toHaveAttribute( 'readonly' );
const titleValue = await page
.getByRole( 'tabpanel', { name: 'Settings' } )
.getByLabel( 'Title attribute' )
Expand Down Expand Up @@ -700,7 +700,7 @@ test.describe( 'Block bindings', () => {
page
.getByRole( 'tabpanel', { name: 'Settings' } )
.getByLabel( 'Alternative text' )
).toBeDisabled();
).toHaveAttribute( 'readonly' );
const altValue = await page
.getByRole( 'tabpanel', { name: 'Settings' } )
.getByLabel( 'Alternative text' )
Expand Down Expand Up @@ -1108,7 +1108,7 @@ test.describe( 'Block bindings', () => {
page
.getByRole( 'tabpanel', { name: 'Settings' } )
.getByLabel( 'Alternative text' )
).toBeDisabled();
).toHaveAttribute( 'readonly' );
const altValue = await page
.getByRole( 'tabpanel', { name: 'Settings' } )
.getByLabel( 'Alternative text' )
Expand Down Expand Up @@ -1184,7 +1184,7 @@ test.describe( 'Block bindings', () => {
page
.getByRole( 'tabpanel', { name: 'Settings' } )
.getByLabel( 'Title attribute' )
).toBeDisabled();
).toHaveAttribute( 'readonly' );
const titleValue = await page
.getByRole( 'tabpanel', { name: 'Settings' } )
.getByLabel( 'Title attribute' )
Expand Down Expand Up @@ -1254,7 +1254,7 @@ test.describe( 'Block bindings', () => {
page
.getByRole( 'tabpanel', { name: 'Settings' } )
.getByLabel( 'Alternative text' )
).toBeDisabled();
).toHaveAttribute( 'readonly' );
const altValue = await page
.getByRole( 'tabpanel', { name: 'Settings' } )
.getByLabel( 'Alternative text' )
Expand Down

0 comments on commit 0a92dc2

Please sign in to comment.