willnguyen1312 / zoom-image

A little yet powerful framework agnostic headless library to zoom images on the web

Home Page:https://willnguyen1312.github.io/zoom-image/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Need to add alt text to zoom image for accessibility

arobbins opened this issue · comments

Description of the problem

While running my site through the axe DevTool, I received errors relating to missing alt text.

After investigating, it appears the dynamically generated image from zoom-image does not contain an alt attribute. See attachment below.

Can you provide an option to pass in a custom alt text to these dynamically generated images?

Screenshot 2024-01-26 at 12 04 04 PM

Hi @arobbins, sorry for taking so long for replying on this issue as I was occupied at work. I am going to investigate this and get back to you soon :)

Hi there, I updated the API so that now we can pass some properties to the generated image under zoomImageProps object - https://willnguyen1312.github.io/zoom-image/api/createZoomImageHover.html#type-declaration. Please feel free to let me know if something does not work as expected. Thanks :)

Thank you Nam!