Repository navigation
fix(editor): improve control accessibility - #140
Conversation
There was a problem hiding this comment.
Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.
An organization owner can choose the repository organization as the billing source for reviews requested by members with a paid Copilot license. Learn about Copilot code review billing.
anurag629
left a comment
There was a problem hiding this comment.
Thanks @VishalDipake, this works. I ran it on the photo overlay, difficulty badge and product card templates: Chrome's accessibility tree has the right name for every control now (the hex fields say "Background hex value" and so on), clicking each label focuses its field, Tab reaches Upload and Space opens the file picker.
Three small things:
- The focus ring on Upload uses
--border-strong, which is#D4D4D4on a#FAFAFApage, so it's hard to see. It looks a lot like the button's own border. The site's focus style isoutline: 2px solid var(--accent-primary)(src/styles/global.css, line 620), so please use that here too. - The five components now use double quotes, and some lines the fix doesn't touch were reformatted (the font options, the function signatures,
[onChange],). The rest of the editor uses single quotes, so please undo the formatting and keep only the lines the fix needs. Same for the extra blank lines around the new rules ineditor.css. - The issue asks for a note on the accessibility tree check. One line in "How I tested this" is enough, for example the names DevTools' Accessibility pane shows for the color, hex, select, slider and upload controls.
anurag629
left a comment
There was a problem hiding this comment.
Thanks @VishalDipake, that's it. The Upload focus ring is easy to see now, and on top of current dev the check, all 494 tests and the build pass. I ran the three templates again: every control has the right name in Chrome's accessibility tree, clicking each label focuses its field, and Tab and Space reach the file picker. One thing for next time: the accessibility tree check in "How I tested this" should be your own. It's two minutes in DevTools' Accessibility pane. Merging.
It's your first merged PR here, so come say hi on our Discord too: https://discord.gg/mpGdJyjaRQ
|
Thanks for the review and for merging my first PR here! Really appreciate the detailed feedback. I'll make sure to perform the accessibility-tree check myself next time. Excited to contribute more and get to know the community! 🙌 |
Description
Fixes issue #77 by improving label associations and keyboard accessibility in the editor's field components.
These changes help assistive technologies identify controls correctly and allow keyboard users to reach the file upload control.
Closes #77
How I Tested This
git diff --check— passed.npm run check— passed with 0 errors.npm run test— 482 tests passed across 22 test files.npm run build— passed.AI Assistance
Used ChatGPT to help interpret the issue requirements and review accessibility implementation options. I implemented the changes and ran the checks and tests locally.