Skip to content

Commit

Permalink
Admin page: remove alt attribute from decorative icon (#34715)
Browse files Browse the repository at this point in the history
The Alt value isn't necessary here, since the icon doesn't bring any additional info on the page for folks using screen readers.

This has the added benefit of getting rid of a React warning:

```
Warning: Failed prop type: Invalid prop `alt` of type `object` supplied to `PlanIcon`, expected `string`.
PlanIcon@wp-content/plugins/jetpack/_inc/build/admin.js?ver=15a830895a6f6d1e3c39:44686:1
MyPlanCard@wp-content/plugins/jetpack/_inc/build/admin.js?ver=15a830895a6f6d1e3c39:51709:20
```
  • Loading branch information
jeherve authored Dec 21, 2023
1 parent d1445f4 commit 17fb4ff
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ const MyPlanCard = ( {
<div className={ cardClassNames }>
<div className="my-plan-card__primary">
<div className="my-plan-card__icon">
{ productSlug && <PlanIcon plan={ productSlug } alt={ title } /> }
{ productSlug && <PlanIcon plan={ productSlug } alt="" /> }
</div>
<div className="my-plan-card__header">
{ title && <h2 className="my-plan-card__title">{ title }</h2> }
Expand Down
4 changes: 4 additions & 0 deletions projects/plugins/jetpack/changelog/fix-admin-plan-icon-alt
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
Significance: patch
Type: other

Admin Page: remove alt attribute from decorative icon.

0 comments on commit 17fb4ff

Please sign in to comment.