ng2-pdfjs-viewer
ng2-pdfjs-viewer copied to clipboard
Accessibility: title attribute for the iframe is not meaningful
Currently, the iframe title attribute is hard set within the template to ng2-pdfjs-viewer:
https://github.com/intbot/ng2-pdfjs-viewer/blob/5f93415482fa0d3aae34205c7c0e970405010e26/dist/index.js#L357
For screen readers users, they're not able to understand what type of content to expect within an iframe (2.4 NavigableTitles on Frames (2.4.1.b). It would be useful to be able to set the title on the component attr and have it reflect appropriately to the iframe.
The short term workaround is to simply target the iframe and hot wire the title:
document.querySelector("ng2-pdfjs-viewer > iframe").title = "My Special Document";
If there is a arch direction you'd like to provide, happy to make a PR.
@justinribeiro My experience with accessibility adherence is quite limited. Please send me a PR if you have time, I will gladly merge(This library is extremely simple at 300 lines of code)