Repository navigation
[Component Audit] DateRangeInput: keep range state truthful - #7297
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
|
AI review status for this pull request.
|
PR Analysis Report
|
There was a problem hiding this comment.
Thanks — this keeps DateRangeInput's range state truthful in three places that had drifted apart. Required state is now announced through a valid description on the button trigger (with the obsolete axe baseline exemption removed), the trigger's accessible name and the calendar follow the optimistic value while a save is pending, and clearing the field no longer brings the old selection back when the calendar reopens.
Calendar's newly documented value={null} controlled-empty state is additive and matches what the runtime already did, so existing calls are unaffected. I verified the focused Calendar/DateRangeInput and PowerSearch tests, the core typecheck, and before/after rendered axe results on the Required story; no blocking findings from me.
[Automated review]
User impact
People using DateRangeInput with assistive technology can now hear required state without invalid ARIA, hear the same pending range that is visible while a change saves, and reopen a cleared calendar without the previous range appearing selected.
Problem and solution fit
Three state seams drifted apart:
aria-required, which is not valid on that role;valuewhile the visible trigger read the optimistic value;undefinedto Calendar, allowing Calendar to fall back to its old internal range.The fix keeps the existing button contract. Required state uses the established localized hidden-description pattern, the trigger name and Calendar both consume the optimistic controlled value, and Calendar documents
nullas its explicit controlled-empty value.Expected behavior and authority
DateRangeInputFR1 requires one controlled range without a competing selected range.family:input-fieldsFR6 requires optimistic value feedback duringchangeAction.aria-describedbytarget rather than unsupportedaria-required.Smallest restoration
Calendar.valueonly widens its type to admit thenullcontrolled-empty state already handled at runtime.Credit: this repair incorporates the problem reports and implementation evidence from #4689 and #6935.
Audit score
Rubric 1.16.6:
Changed sections: accessibility 2.5→4.5, behavior 3→5, testing 4→5. Other section scores are unchanged.
Evidence
aria-allowed-attrbaseline row.94f81034f22306ca4329c111c6c2df0224ef1cfe.Scope
Testing
pnpm lint:strictpnpm build