-
Notifications
You must be signed in to change notification settings - Fork 71
LG-3879: fix(DatePicker) Updates DatePicker Next/Prev button aria-labels #3224
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
🦋 Changeset detectedLatest commit: e33f9b9 The changes in this PR will be included in the next version bump. This PR includes changesets to release 1 package
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR improves the accessibility of the DatePicker component by updating ARIA labels for navigation buttons and select elements, and hiding calendar cell text from screen readers to prevent redundant announcements.
Key Changes:
- Enhanced ARIA labels for previous/next month navigation buttons to include destination month information
- Updated month and year select elements with clearer ARIA labels using parenthetical notation
- Added
aria-hiddenattribute to calendar cell text spans to prevent duplicate screen reader announcements
Reviewed Changes
Copilot reviewed 7 out of 7 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| CalendarCell.tsx | Added aria-label prop handling and aria-hidden attribute to cell text |
| DatePickerMenuSelectYear.tsx | Improved year select aria-label format and extracted year string variable |
| DatePickerMenuSelectMonth.tsx | Updated month select aria-label format and added getMonthName import |
| DatePickerMenuHeader.tsx | Refactored chevron button aria-labels to include destination month information |
| DatePickerMenu.spec.tsx | Updated tests to use data-testid selectors and verify aria-label content |
| DatePicker.testutils.tsx | Switched from aria-label to data-testid selectors for chevron buttons |
| date-picker-aria.md | Added changeset documentation for the accessibility improvements |
packages/date-picker/src/shared/components/Calendar/CalendarCell/CalendarCell.tsx
Outdated
Show resolved
Hide resolved
...ages/date-picker/src/DatePicker/DatePickerMenu/DatePickerMenuHeader/DatePickerMenuHeader.tsx
Show resolved
Hide resolved
Co-authored-by: Copilot <[email protected]>
...ages/date-picker/src/DatePicker/DatePickerMenu/DatePickerMenuHeader/DatePickerMenuHeader.tsx
Outdated
Show resolved
Hide resolved
|
Size Change: +240 B (+0.02%) Total Size: 1.6 MB
ℹ️ View Unchanged
|
✍️ Proposed changes
'@leafygreen-ui/date-picker': patch
LG-3879
Updates ARIA labels for DatePicker menu previous/next buttons, and year/month select elements.
Hides calendar cell text, so screen-readers only read the cell's
aria-value.