Open nadchif opened 4 years ago
Interesting observation, what would be the best way to listen on the DOM for dynamic changes to images 🤔... there should be a way to listen to each element as opposed to a diff on all elements right?
A good place to start maybe https://developer.mozilla.org/en-US/docs/Web/API/MutationObserver.
body
--> track newly added img
elementsimg
where we add an alt
--> track src
changesYes... that looks like it can work pretty well. So just added a Mutation Observer to each img
child's src
when we are add alt attributes....
We would also need need to add a mutation observer to the whole body and listen for new img
elements as well.
Describe the bug Right now everything works just well, when Image a11y processes the page on initial load. However, when content is loaded or changes dynamically, the alt labels are not updated. This leads to scenario where 'apples' are still labelled as 'oranges'.
To Reproduce Steps to reproduce the behavior:
Expected behavior Detect image src and DOM changes in order to update the alt labels dynamically
Desktop (please complete the following information):