-
Notifications
You must be signed in to change notification settings - Fork 1.8k
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
Refactor ariaLabel
props to aria-label
#12802
Comments
Thanks for bringing this up @ItsMarcoMSF - yes, usages of We intended to ship this as part of v11, #9535, but it fell out of scope. There are currently 13 usages that need to be refactored: https://carbon-react-explorer.vercel.app/props/ariaLabel |
ariaLabel
props to aria-label
I just updated the issue title and body with a new "Plan of action" section outlining the work that needs done. This issue is a lower priority item for our team, but we'll happily accept PRs if you're open to contributing! |
@tay1orjones Thanks for replying to the issue. I'm open to contribute, let me know if you have a timeline in mind! |
@ItsMarcoMSF Whatever timeline works for you! We won't be able to pick this up for quite some time unfortunately. It's all in the contributing.md, but at a high level just fork the repo into your personal account, make a branch, make the changes, commit/push up, and open a PR. As this is a change to props on a component you may need to regenerate the public API snapshot via Let me know if I can help get you up and running. You could start with a single component and just ref this issue # |
Hey team - good find with the aria inconsistencies. I'm going to start working on some fixes for this. |
@tay1orjones this is a rather large body of work for all of this. I could break it down into multiple PRs for merging to get some things out there door sooner. How would you prefer something like this be handled? |
@tay1orjones Can you clarify what to do with the following regarding
|
@jsehull Yeah, I would sequence it out into separate PRs per component to get it out the door sooner. The list of components to refactor was generated by searching the codebase for InlineCheckbox is used in a few spots - TableSelectRow, TableSelectAllRow, etc. and can be viewed in those DataTable stories using those components. Also I think we can just ignore any feature requests for now and focus on updating the existing API in the state it's in. |
Below are some of my progress updates in case others are monitoring. Items removed:
Not started:In process:
Completed codeDone (PR created)
|
8 of 12 completed and pending PR approvals. 4 of 12 remaining:
The table section is proving more challenging, though the fix should be nearly the same. I'm having varying degrees of success getting those working. At best, for some, I get the new For now I'm moving on to other Issues. Anyone is welcome to hop in and try these out! Whoever works on this next can reference recent fixes as the updates should be similar. Once a solution is found and properly tested, I run the following to ensure that snapshots are updated. It's common to have to fix tests afterwards.
|
Still a few left to complete |
@tay1orjones @tw15egan do yall mind if i help out with this? |
Go for it @TannerS 🎉 |
@tay1orjones @tw15egan May I help by working on this? |
Sure thing @fitrahfm 👍🏻 |
Click to expand details
Package
carbon-components, carbon-components-react
Browser
Chrome
Operating System
MacOS
Package version
[email protected] & [email protected]
React version
v16.14.0
Automated testing tool and ruleset
IBM Equal Access Accessibility Checker
Assistive technology
No response
Description
According to @carbon/[email protected] storybook, the Modal component accepts a prop called
aria-label
.However, in most other Carbon components in react, the prop
ariaLabel
is acceptedCan there be at least consistency between components in this area? A deeper dive into the source can also show that a number of components still accepts
aria-label
as a prop while the storybook saysariaLabel
. And then there are other components that only accept one ofariaLabel
oraria-label
and not both.According to React's official document on WAI-ARIA: https://reactjs.org/docs/accessibility.html#wai-aria:
So perhaps, the best approach is to support
aria-label
in all components?WCAG 2.1 Violation
No response
Reproduction/example
Not applicable.
Steps to reproduce
Not applicable.
Code of Conduct
Plan of action
As described below, Components with the prop
ariaLabel
need to be refactored toaria-label
. We wanted to ship this as part of v11, #9535, but it fell out of scope. There are currently 13 usages that need to be refactored: https://carbon-react-explorer.vercel.app/props/ariaLabelComponents to update
Steps to complete for each component
ariaLabel
by updating to usedeprecate()
aria-label
prop -- e.g.['aria-label']: PropTypes.string,
ariaLabel
to preferaria-label
if it's provided. Both props need to work for the time being to remain backwards compatibilityThe text was updated successfully, but these errors were encountered: