-
Notifications
You must be signed in to change notification settings - Fork 47k
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
[SVG] Support "focusable" attribute #6212
Comments
React 15 removed whitelisting attributes for SVG completely in #5714. The names left in the whitelist are only there to print deprecation warnings. You will find that any arbitrary attribute, including React 15 RC1 was shipped yesterday so I would suggest you to check it out. I would expect 15 to arrive shortly within a few weeks. |
Thanks 👍 |
Seems like we’re going to go back on that change (see #6243). Are there any browsers that actually support |
IE10, IE11, and Edge support It's a pretty annoying accessibility issue for keyboard users in those browsers. |
cc @tomocchino whitelists... :P |
Hey there. It seems that <svg
- focusable={false}
+ focusable="false" I find it rather surprising considering other boolean attributes such as Maybe I missed something? |
AFAIK it's expected because |
Yes. I can't remember if we achieved consensus on the best way to handle boolean attributes but, from what I remember, it follows:
I believe we have some inconsistency to retain backwards compatibility, though I'm not sure of a specific example off-hand. |
Looks like we have a "boolean-ish" section for some SVG: Does it make sense to add focusable here? |
That makes sense. I’m not sure accepting both a string or a boolean would be dramatically better. It would certainly make things less confusing from an authoring stand point, but introduces a bit of a code smell (expecting multiple types).
This is what confused me: It seems to me that we have an opportunity to make things a bit more consistent. Maybe by making |
I think we're open to changes to this in case you want to write up a proposal. |
Yes, my colleagues and I can surely come up with something. Is there a specific format you’re expecting for this or shall it just be what we think would be a good improvement on the current implementation? |
Just file an issue with a free form description of how it should work and why |
It's kind of a messy situation, since we're dealing with three separate specifications (HTML, SVG, ARIA) and they don't always use consistent terms when describing attribute behavior. Ideally, every specification would define the attributes as either boolean attributes or enumerated attributes and we could just conform to those specs and only allow This would be the easiest approach from an implementation standpoint, but I do think there's value in making it work how the user expects it to. If an attribute is an enumerated attribute with I don't think having the attributes be polymorphic is that bad of a code smell. It just results in some simple coercion that React does anyways. |
Moved to #12481. |
Currently, if I supply a
focusable
attribute to the SVG, it shrinks it out. Seems it happens because there is nofocusable
key in SVGDOMPropertyConfig.js.So is there any chance you merge a PR which adds this property to the list?
The text was updated successfully, but these errors were encountered: