-
Notifications
You must be signed in to change notification settings - Fork 94
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Accessibility and replacing title/description inside of the svg #639
Comments
If you are okay with this proposal I would love to create the PR for this. |
Hi @bitboxer 👋 Sounds like you're using the API as intended here. Assuming I've understood your use-case correctly:
I've created a live example here. Is this similar to what you've done? I can understand why you're wanting a bit more convenience from this libraries API. A deliberate tradeoff was made some time ago which gave more power but pushed complexity such as this into user-land in order to prevent a larger API surface area. See here for context. For that reason, I'm hesitant to expand the API. Still interested in seeing your proposal if you want to share it here though. Finally, if this is too inconvenient for you, I'd suggest taking a look at react-inlinesvg which is a similar library but has a slightly different API which might suit your use-case better. |
Yes, the example is what I did in our codebase. My proposal would be adding a |
Yep, agree on making things more obvious in some way regarding a11y. Still hesitant to expand the API in that way just yet though, so in the meantime, I'll add some documentation and an example based on what we've talked about here. |
Just merged #648. As per the PR desc., the FAQ section might not be in the best place, but we can update that in future, along with adding further FAQ based on past issue questions. |
I understand your decision, but I really hope that you will change your mind in the near future and see that accessibility should not be hidden in a FAQ, but should be real attributes. |
To clarify, the intent behind adding both an FAQ and live example was not to hide that information, but to make it more obvious, since previously it wasn’t documented at all. It’s a stepping stone towards potentially modifying the API, so if anything changes in this regard in future, I’ll be sure to ping you 🙂 |
Released in |
It would be great if it would be possible to update the
title
anddesc
attribute of the svg to have a proper description based on the context where the svg is used. Also addingrole="img"
might be helpful, too.I am currently adding all of that using the hooks ReactSVG provides, but having them inside of the library would be super nice.
The text was updated successfully, but these errors were encountered: