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](https://private-user-images.githubusercontent.com/961947/300070054-5a49bc9f-115a-4f0d-b604-e6accf89d9e4.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MjI5Mjc4NTMsIm5iZiI6MTcyMjkyNzU1MywicGF0aCI6Ii85NjE5NDcvMzAwMDcwMDU0LTVhNDliYzlmLTExNWEtNGYwZC1iNjA0LWU2YWNjZjg5ZDllNC5wbmc_WC1BbXotQWxnb3JpdGhtPUFXUzQtSE1BQy1TSEEyNTYmWC1BbXotQ3JlZGVudGlhbD1BS0lBVkNPRFlMU0E1M1BRSzRaQSUyRjIwMjQwODA2JTJGdXMtZWFzdC0xJTJGczMlMkZhd3M0X3JlcXVlc3QmWC1BbXotRGF0ZT0yMDI0MDgwNlQwNjU5MTNaJlgtQW16LUV4cGlyZXM9MzAwJlgtQW16LVNpZ25hdHVyZT1lNjQxOGI5Y2U5N2IyZjhiYTA0YzExZDFhZjZlNGVmMzQzN2Q2MjNhMDNkNzZmNTAxOWU1NzNkZTBhMmZjZGFkJlgtQW16LVNpZ25lZEhlYWRlcnM9aG9zdCZhY3Rvcl9pZD0wJmtleV9pZD0wJnJlcG9faWQ9MCJ9.k9KwTd6ci2WdJ3ykHBhLah6m-01XUgzsCkorKQxWurU)
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!