feat: add keyboard accessibility for timepicker#2613
feat: add keyboard accessibility for timepicker#2613bradenmacdonald merged 11 commits intoopenedx:masterfrom
Conversation
|
Thanks for the pull request, @asajjad2! This repository is currently maintained by Once you've gone through the following steps feel free to tag them in a comment and let them know that your changes are ready for engineering review. 🔘 Get product approvalIf you haven't already, check this list to see if your contribution needs to go through the product review process.
🔘 Provide contextTo help your reviewers and other members of the community understand the purpose and larger context of your changes, feel free to add as much of the following information to the PR description as you can:
🔘 Get a green buildIf one or more checks are failing, continue working on your changes until this is no longer the case and your build turns green. DetailsWhere can I find more information?If you'd like to get more details on all aspects of the review process for open source pull requests (OSPRs), check out the following resources: When can I expect my changes to be merged?Our goal is to get community contributions seen and reviewed as efficiently as possible. However, the amount of time that it takes to review and merge a PR can vary significantly based on factors such as:
💡 As a result it may take up to several weeks or months to complete a review and merge your PR. |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #2613 +/- ##
=======================================
Coverage 94.90% 94.90%
=======================================
Files 1235 1235
Lines 28260 28271 +11
Branches 6433 6440 +7
=======================================
+ Hits 26819 26830 +11
Misses 1370 1370
Partials 71 71 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
|
Thanks, this looks nice! Please let me know when it's ready for review. Also, will this work with v8 ? #2572 |
bradenmacdonald
left a comment
There was a problem hiding this comment.
Thanks for this PR! Unfortunately I am seeing a few issues.
Here is a screenshot of Chrome's a11y view showing all the issues:
- The
ariaLabelprop you gave is being ignored. If you put// @ts-checkat the top of the file, you'll see thatDatePickerdoesn't accept anariaLabelprop, and it also seems to ignorearia-label. You can also see in my screenshot that this element has no accessible name/label other than its placeholder ("HH:MM") which isn't helpful.

- There is a
<label>element from the<Form.Group>that is supposed to be providing a label (e.g. "Course start time") for this control, but theidprop is not being set on the<DatePicker>/<input>element, so theForm.Groupis broken and the label is invalid - which Chrome's a11y viewer is warning about. We need to either generate a unique ID and pass it to theForm.GroupascontrolId, or use the form group context to get the auto-generated ID and pass it in to the<DatePicker>/<input>. This is affecting the dates as well as the times.
e29b26b to
f287668
Compare
|
@bradenmacdonald For additional context, we use Form.Text and Form.Control.Feedback with ids, and pass those IDs via aria-describedby so screen readers announce the time-format instructions and any help text after the label. |
bradenmacdonald
left a comment
There was a problem hiding this comment.
Thanks for fixing this! It's working well now as far as I can tell.
What are the relevant tickets?
#9097
Description (What does it do?)
Time fields in Schedule settings rely on react-datepicker's time-only popover. This PR adds ARIA labels and screenreader hints to improve accessibility for keyboard and screen-reader users.
Note: Keyboard navigation (ArrowUp/ArrowDown and Enter key) for the time picker is now handled upstream in react-datepicker. This PR focuses solely on adding proper ARIA labels and screenreader instructions.
The changes include:
ariaLabelto the time picker input with instructions about using arrow keysariaDescribedByto associate the input with screenreader hintsidattributes for ARIA associationsScreencast (this is now handled in react-datepicker upstream)
Screen.Recording.2025-11-11.at.3.38.55.PM.mov
How can this be tested?
aria-labelandaria-describedbyattributes