Skip to content

Commit

Permalink
Fix alt attribute on deprecations
Browse files Browse the repository at this point in the history
  • Loading branch information
renatho committed Oct 25, 2024
1 parent 99aa8f9 commit 330fabe
Showing 1 changed file with 12 additions and 4 deletions.
16 changes: 12 additions & 4 deletions packages/block-library/src/cover/deprecated.js
Original file line number Diff line number Diff line change
Expand Up @@ -164,7 +164,7 @@ const v8ToV11BlockAttributes = {
},
};

const v12toV13BlockAttributes = {
const v12BlockAttributes = {
...v8ToV11BlockAttributes,
useFeaturedImage: {
type: 'boolean',
Expand All @@ -176,8 +176,16 @@ const v12toV13BlockAttributes = {
},
};

const v13BlockAttributes = {
...v12BlockAttributes,
alt: {
type: 'string',
default: '',
},
};

const v14BlockAttributes = {
...v12toV13BlockAttributes,
...v13BlockAttributes,
isUserOverlayColor: {
type: 'boolean',
},
Expand Down Expand Up @@ -420,7 +428,7 @@ const v14 = {

// Deprecation for blocks that does not have the aria-label when the image background is fixed or repeated.
const v13 = {
attributes: v12toV13BlockAttributes,
attributes: v13BlockAttributes,
supports: v12BlockSupports,
save( { attributes } ) {
const {
Expand Down Expand Up @@ -570,7 +578,7 @@ const v13 = {

// Deprecation for blocks to prevent auto overlay color from overriding previously set values.
const v12 = {
attributes: v12toV13BlockAttributes,
attributes: v12BlockAttributes,
supports: v12BlockSupports,
isEligible( attributes ) {
return (
Expand Down

0 comments on commit 330fabe

Please sign in to comment.