Skip to content

Commit

Permalink
fix: even if there is not alt text, the attribute must always be pres…
Browse files Browse the repository at this point in the history
…ent for assistive technolgies
  • Loading branch information
mbleuer committed Apr 22, 2024
1 parent 117b38c commit f688448
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/components/image/image.e2e.ts
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ describe(`sbb-image with ${fixture.name}`, () => {
<source media="(min-width: 64rem)" sizes="1200px" srcset="${url}?auto=format%2Ccompress%2Ccs%3Dtinysrgb&amp;w=1200&amp;h=675&amp;q=45 1200w, ${url}?auto=format%2Ccompress%2Ccs%3Dtinysrgb&amp;w=2400&amp;h=1350&amp;q=20 2400w">
<source media="(min-width: 37.5rem)" sizes="976px" srcset="${url}?auto=format%2Ccompress%2Ccs%3Dtinysrgb&amp;w=976&amp;h=549&amp;q=45 976w, ${url}?auto=format%2Ccompress%2Ccs%3Dtinysrgb&amp;w=1952&amp;h=1098&amp;q=20 1952w">
<source media="(max-width: 37.4375rem)" sizes="320px" srcset="${url}?auto=format%2Ccompress%2Ccs%3Dtinysrgb&amp;w=320&amp;h=180&amp;q=45 320w, ${url}?auto=format%2Ccompress%2Ccs%3Dtinysrgb&amp;w=640&amp;h=360&amp;q=20 640w">
<img class="image__img" decoding="auto" height="562" loading="eager" src="${url}" width="1000">
<img alt="" class="image__img" decoding="auto" height="562" loading="eager" src="${url}" width="1000">
</picture>
</div>
</figure>
Expand Down
2 changes: 1 addition & 1 deletion src/components/image/image.ts
Original file line number Diff line number Diff line change
Expand Up @@ -507,7 +507,7 @@ export class SbbImageElement extends LitElement {
];
})}
<img
alt=${this.alt || nothing}
alt=${this.alt || ''}
@load=${this._imageLoaded}
class="image__img"
src=${this.imageSrc!}
Expand Down

0 comments on commit f688448

Please sign in to comment.