-
Notifications
You must be signed in to change notification settings - Fork 275
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
fix(aside): add spread prop, update docs with accessibility labe… #567
fix(aside): add spread prop, update docs with accessibility labe… #567
Conversation
This pull request is being automatically deployed with ZEIT Now (learn more). 🔍 Inspect: https://zeit.co/carbon-design-system/gatsby-theme-carbon/jywbjd77e |
@dakahn I was wondering if you could take a look at this when you get a chance and let me know if you agree with my assumptions + my approach here? Thank you! 🙏 |
a |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@jendowns interested to hear what @dakahn thinks, but I think this might be an issue with DAP.
under ARIA13: Using aria-labelledby to name regions and landmarks I'd argue that the aside element falls under the category of landmarks not needing a label:
- No label is required for landmark regions where the purpose is obvious from the role (e.g., main, banner, search, or contentinfo).
@vpicone Here's some more info I found in my research, outside of DAP:
It's possible that DAP flags all |
@jendowns Oooooo you're super right. In hindsight the components I listed generally usually show up once a page where that's definitely not the case here. What do you think about just passing all of the props through without the check? I'd like to be more consistant with this but in theory they should be able to just treat it like a regular As is, we'd be retroactively converting everyone's |
Just made the following changes to the PR --
However in the process I noticed that links inside low-contrast And in the meantime, I added an override in this library to fix the issue until the fix is released & absorbed here: // TODO: remove when fix is released. See https://github.com/carbon-design-system/carbon/issues/4804
.bx--inline-notification--low-contrast:before {
pointer-events: none !important;
} Let me know what you think! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Very cool! 🏄 Thanks again @jendowns
}; | ||
|
||
render() { | ||
const { children, className } = this.props; | ||
const { | ||
ariaLabel, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Since we're not using a using a div, we don't have to de-structure these or switch the case, we can just pass them through right?
That way devs use them just like they would on a native aside
jsx element.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks a bunch for the docs, looks great.
Can we just pass these on through and update the examples to use the normal jsx aria props?
@vpicone I'm reluctant to do that because with the props explicitly defined in this way, their usage is more normalized. They are elevated to be a more vital part of the component structure. If they aren't called out in this way--as recommended & documented props--then we are kinda back to square one where the accessibility of this component is dependent upon the knowledge of the user / or the user's commitment to checking with DAP. 🤔 (Admittedly the added documentation to the Plus I'm thinking of other examples within Carbon core (specifically the React library) where aria props are explicitly defined even if they aren't necessarily required in a specific situation. What do you think? |
@jendowns I think the react library opting for non-standard, camel-case props was a mistake. I don’t think developers should need to memorize/track which components use native/standard aria capitalization and which ones get morphed by Carbon. What do you think about leaving them in as prop-types/in the prop table. Like you said they’re pretty critical here. But I think we should use the native capitalization. They also shouldn’t be required as their only required when multiple exist on a page and there’s not a great way for us to make that assertion at run time. |
Thanks @vpicone! I just made the changes you suggested above. Let me know what you think 🎉 |
@jendowns brilliant, thanks! |
Closes #566
Currently the
Aside
component renders an<aside>
element that is missing required accessibility labels. This<aside>
element needs either anaria-label
attribute (to provide a label) oraria-labelledby
attribute (to use an existing element, like a heading, as a label) per Checkpoint 2.4.1This PR
proposes addingupdates examples and documentation to includeariaLabel
andariaLabelledBy
props so that users can provide either of these required accessibility labels, depending on their context/situationaria-label
andaria-labelledBy
If one of these accessibility labels are NOT provided, then theAside
component will render a<div>
element inside of an<aside>
.Changelog
New
ariaLabel
andariaLabelledBy
props with documentationChanged