react-component / react-component/input-number
Axe accessibility tool reports issue of role="spinbutton" div not having a label
Nobody has claimed this yet.
- Dominant language
- TypeScript
- Stars
- 323
- Forks
- 188
- Avg merge
- 20h 3m
- Merged PRs (30d)
- 1
Description
Users are unable to pass in an aria attribute (such as aria-label) to this particular div where the role="spinbutton", and it is not being set in the component itself, so it is causing an accessibility issue.
I am able to use the component and add my own label (I'm wrapping and styling the component and adding the label in the below image) but this Axe reported issue still happens.
Repro steps:
- Go to example usage of the input-number component
- Make sure you have either the Axe browser extension installed and able to be run in your dev tools, or use the Storybook accessibility tool which uses Axe.
- Run the tool on the page that uses input-number
You will see a reported issue "Ensures every ARIA input field has an accessible name"
Potential fixes could be
- Allowing users to pass in an aria-label that is applied to this div
- Move the
role="spinbuttonand all of the aria attributes off of this div and below to theinputelement which is the div's child (preferred)
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start at src/index.js around line 776 and reproduce the report using the example usage with the Axe browser extension or Storybook accessibility tool. Trace the role="spinbutton" div and its child input, then verify the chosen accessibility change removes the "Ensures every ARIA input field has an accessible name" report.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- react, typescript
- Domain
- accessibility, frontend
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 45/100