-
Notifications
You must be signed in to change notification settings - Fork 82
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
Attribute support: aria-labelledby #43
Comments
@chipcullen Try using the next version of svg-react-loader I've done away with handling special attributes, and that version has a better API for special casing these kind of things (if that becomes necessary). Thanks, ;-j |
@jhamlet I just tried, and unfortunately, no dice :( I ran
And when I run
Even though the directory in Anyway, I can run webpack just fine, but I still get this console error in the browser:
When inspecting the SVG in my browser dev tools, the If it helps, here is the React file with JSX: And here is what I'm seeing in the browser vs what is in the SVG file: And here is the browser console: |
@chipcullen thanks for the details. I don't know what npm's issue is, but it looks like you're getting the correct version. As a quick test (sorry, my bandwidth is limited at this time) can you try outputting an svg element through React (not using svg-react-loader, just plain react) with a property The processor recognizes hyphens as places to camelCase things, however there is a way to special-case certain attribute names (look at the |
I've recreated everything as per @chipcullen above and carried on with ^^. I dropped an SVG inline into a JSX file and got the following:
All of above rendered through |
I am having the same issue as @chipcullen. Dropping in the SVG directly the attributes are printed. I've tried to use the ´propsMap´ query parameter, but It didn't do any difference. (I don't know if I used it correctly) |
Per the summary:
One issue that we are running into, however, is using the
aria-labelledby
attribute. When authoring SVGs, this attribute can be used on the root<svg>
element to aid screenreaders correctly announce what the SVG is supposed to be. Example usage:(More background on this can be found on Tip #3 here)
React handles the
aria-labelledby
attribute just fine when the SVG is pasted directly into JSX - but, when loaded via svg-react-loader you get this console error:Would it be possible to amend SVG react loader to handle
aria-labelledby
, in addition to the other attributes it handles?The text was updated successfully, but these errors were encountered: