Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Image: Mark connected controls as 'readonly' #59059

Merged
merged 2 commits into from
Feb 15, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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 @@ -533,7 +533,7 @@ export default function Image( {
label={ __( 'Alternative text' ) }
value={ alt || '' }
onChange={ updateAlt }
disabled={ lockAltControls }
readOnly={ lockAltControls }
help={
lockAltControls ? (
<>
Expand Down Expand Up @@ -575,7 +575,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
16 changes: 8 additions & 8 deletions test/e2e/specs/editor/various/block-bindings.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -876,7 +876,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 @@ -939,7 +939,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 @@ -1018,7 +1018,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 @@ -1081,7 +1081,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 @@ -1137,7 +1137,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 @@ -1545,7 +1545,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 @@ -1621,7 +1621,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 @@ -1691,7 +1691,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
Loading