Skip to content

fix: Fix ariaLabel support for date range picker#4331

Open
avinashbot wants to merge 4 commits intomainfrom
drp-aria-label
Open

fix: Fix ariaLabel support for date range picker#4331
avinashbot wants to merge 4 commits intomainfrom
drp-aria-label

Conversation

@avinashbot
Copy link
Member

@avinashbot avinashbot commented Mar 4, 2026

Description

Turns out the ariaLabel attribute doesn't actually work on the date range picker — because there's always an aria-labelledby coming from the trigger itself, which always overrides aria-label. Whoops. Not breaking any new ground with the implementation here; keeping the implementation consistent with what we do in the select component.

One thing I did change is moving ariaLabel out of i18nStrings and putting it in the top level. This is also consistent with what we did in other components; it was just missed in this one. i18nStrings are for properties that are always static, not situation-dependent.

Related links, issue #, if available: AWSUI-61769

How has this been tested?

Added unit tests.

Review checklist

The following items are to be evaluated by the author(s) and the reviewer(s).

Correctness

  • Changes include appropriate documentation updates.
  • Changes are backward-compatible if not indicated, see CONTRIBUTING.md.
  • Changes do not include unsupported browser features, see CONTRIBUTING.md.
  • Changes were manually tested for accessibility, see accessibility guidelines.

Security

Testing

  • Changes are covered with new/existing unit tests?
  • Changes are covered with new/existing integration tests?

By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.

inlineTokens?: boolean;
ariaHasPopup?: 'true' | 'listbox' | 'dialog';
ariaControls?: string;
ariaLabel?: string;
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not used anymore, since the select trigger also switched to the ariaLabelledby-only implementation.

@avinashbot avinashbot marked this pull request as ready for review March 5, 2026 01:18
@avinashbot avinashbot requested a review from a team as a code owner March 5, 2026 01:18
@avinashbot avinashbot requested review from a team, amanabiy and cansuaa and removed request for a team and cansuaa March 5, 2026 01:18
@codecov
Copy link

codecov bot commented Mar 5, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 97.43%. Comparing base (50a2f4d) to head (6660cf3).
⚠️ Report is 1 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #4331   +/-   ##
=======================================
  Coverage   97.43%   97.43%           
=======================================
  Files         897      897           
  Lines       26342    26344    +2     
  Branches     9516     9516           
=======================================
+ Hits        25667    25669    +2     
  Misses        669      669           
  Partials        6        6           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants