bnjmnrsh-projs / signal-v-noise

Code kata using the NYT API.
https://bnjmnrsh-projs.github.io/signal-v-noise/
1 stars 0 forks source link

Image ARIA role presentational being flagged in Lighthouse #23

Closed bnjmnrsh closed 10 months ago

bnjmnrsh commented 10 months ago

We almost a perfect accessibility score from Lighthouse, but we have a warning re <img role="presentation">

Screenshot 2023-12-27 at 14 37 10

img.loading-bg appears when the skeleton screen is in a loading state, but the screenshot taken by Lighthouse has the image loaded. I believe this has to do with therole="presentation" not being removed or correctly updated after the skeleton is populated. . .

<img class="loading-bg" 
    scrset="https://static01.nyt.com/images/2023/12/26/multimedia/00nat-michigan-elector-1-jpzw/00nat-michigan-elector-1-jpzw-superJumbo.jpg 2048w, https://static01.nyt.com/images/2023/12/26/multimedia/00nat-michigan-elector-1-jpzw/00nat-michigan-elector-1-jpzw-threeByTwoSmallAt2X.jpg 600w,  https://static01.nyt.com/images/2023/12/26/multimedia/00nat-michigan-elector-1-jpzw/00nat-michigan-elector-1-jpzw-thumbLarge.jpg 150w" src="https://static01.nyt.com/images/2023/12/26/multimedia/00nat-michigan-elector-1-jpzw/00nat-michigan-elector-1-jpzw-threeByTwoSmallAt2X.jpg" height="400" width="600" alt="Bill Pugliano/Getty Images" loading="lazy" role="presentation">