openedx / openedx/paragon

Accessibility issues with <Dropzone> ?

Open
#3,957 0 comments 0 reactions 0 assignees View on GitHub

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.

Image

In Firefox, the internal input gets a role=button and implicit name Browse… … supplied by the browser.

Image

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

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. 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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.