Accessibility issues with <Dropzone> ?
Nobody has claimed this yet.
- Dominant language
- JavaScript
- Stars
- 140
- Forks
- 100
- Avg merge
- 1h 3m
- Merged PRs (30d)
- 30
Description
When using the Dropzone component in tests, its internal <input type="file"> control does not appear to JSDom as an element with a role, and cannot be selected for testing using the getByRole() selector. I would expect it could be selected with something like getByRole('button', { name: "Choose file" }).
In Chrome, the internal input gets a role=button and implicit name Choose File supplied by the browser.
In Firefox, the internal input gets a role=button and implicit name Browse… … supplied by the browser.
Should these be standardized by giving our internal input an explicit accessible name (e.g. aria-label) and role=button ? That would likely resolve the issue where JSdom isn't giving it a role, and allow us to use proper accessible queries in test code.
⚠️ Also, Firefix is giving a11y warnings on both the input ("Interactive elements must be focusable") and the parent div ("Focusable elements should have interactive semantics").
Contributor guide
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
Locate the Dropzone component from the linked documentation and reproduce its file-input behavior in JSDOM using the reported getByRole query. Check the input and parent div in Firefox for the reported accessibility warnings; done means the control has a stable accessible name and appropriate semantics, with tests covering the accessible query.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- javascript, react
- Domain
- accessibility, frontend, testing
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100