fix(DateRangeInput): expose trigger as combobox - #4689
Open
AKnassa wants to merge 1 commit into
Open
Conversation
axe flagged aria-required on the trigger (critical aria-allowed-attr): the attribute is not allowed on role=button. DateInput and DateTimeInput already expose their triggers as role=combobox with aria-haspopup=dialog, so this aligns DateRangeInput with the sibling decision instead of silently dropping the required announcement. Trigger tests move to combobox-role queries; the accessible name (label + value/placeholder) is pinned by name-matched assertions, mutation-proven against aria-label removal. Baseline: -1 entry. Verified: 41/41 tests, eslint clean, axe audit 0 issues across all 17 DateRangeInput stories with --fail-on-new. Part of facebook#4681.
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
AKnassa
marked this pull request as ready for review
August 4, 2026 01:48
AKnassa
requested review from
cixzhang,
ejhammond and
imdreamrunner
as code owners
August 4, 2026 01:48
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Part of #4681 (weekly a11y scan). Clears the critical
DateRangeInput::Required::aria-allowed-attrbaseline entry.What this does
The date range picker's trigger button carried
aria-required, which ARIA does not allow onrole=button, so axe flagged it as critical. The trigger is now exposed asrole="combobox", the same decision DateInput and DateTimeInput already made for their triggers, which makesaria-requiredandaria-invalidlegal and announces the control as what it behaves like: a collapsed picker that opens a dialog.What changed
role="combobox"on the trigger button inDateRangeInput.tsx. The existingaria-expanded,aria-haspopup="dialog"andaria-controlswiring already matches the pattern.aria-labelfails 2 tests.getByRole('button', {name})need to targetcomboboxinstead; screen readers now announce "combobox, collapsed" rather than "button".Considered and rejected
Dropping
aria-requiredfrom the button was the smaller diff, but it silently removes the required announcement and diverges from both sibling date inputs.Not in this PR
The 10 remaining
aria-allowed-attrentries (ChatComposerInput x8, ChatLayout x2) all trace to one node: the composer's editable div flips torole=comboboxwhentriggersare configured while keeping a hardcodedaria-multiline. That file is owned by open PR #4074; the fix belongs there and the entries stay baselined until it lands.Verification
41/41 DateRangeInput tests (plus width-contract and status-icon suites, 85/85), eslint clean, and the repo's axe audit with
--fail-on-new: 0 issues across all 17 DateRangeInput stories.