-
Notifications
You must be signed in to change notification settings - Fork 71
[LG-3832] fix(date-picker): add screen reader announcements for date input segment values #3223
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
Conversation
🦋 Changeset detectedLatest commit: 1df2415 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 enhances accessibility for the date-picker component by adding screen reader announcements when users interact with date input segments. When segment values change, screen readers will announce both the segment type (month, day, year) and the new value.
- Adds screen reader announcements for date input segment value changes
- Uses
VisuallyHidden
component witharia-live="polite"
for announcements - Improves accessibility feedback for screen reader users
<VisuallyHidden aria-live="polite" aria-atomic="true"> | ||
{value && `${segment} ${value}`} | ||
</VisuallyHidden> |
Copilot
AI
Oct 14, 2025
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.
The screen reader announcement may be repetitive or noisy. Consider throttling announcements or only announcing when the value actually changes, rather than on every render when a value exists.
Copilot uses AI. Check for mistakes.
Size Change: +142 B (+0.01%) Total Size: 1.59 MB
ℹ️ View Unchanged
|
<VisuallyHidden aria-live="polite" aria-atomic="true"> | ||
{value && `${segment} ${value}`} | ||
</VisuallyHidden> |
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.
Part of the acceptance criteria of the ticket mentions not announcing "Selection replaced" although I still see that getting flagged. Is the ticket actually wrong? That does seem like what I would expect
However, something I do think worth looking into is why it's repeating the value when incrementing/decrementing. Is there a particular reason for that?
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.
Yeah, I think that "selection replaced" makes some sense because the selection is being replaced.
I assumed it was being read twice because we're rendering it visually hidden and multiple renders are occurring on the segment, perhaps twice due to strict mode?
✍️ Proposed changes
This PR improves accessibility for the date-picker component by adding screen reader announcements when users interact with date input segments. The enhancement uses the
VisuallyHidden
component witharia-live="polite"
to announce segment values (month, day, year) as they change, providing better feedback for screen reader users.🎟️ Jira ticket: LG-3832
✅ Checklist
pnpm changeset
and documented my changes🧪 How to test changes