Repository navigation
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 meta#4681.
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
PR Analysis Report📚 Storybook Preview🧪 Sandbox PreviewModified ComponentsDateRangeInput (@astryxdesign/core) · View in Storybook
PowerSearch (@astryxdesign/core) · View in Storybook
Bundle Size Summary
Accessibility AuditStatus: 1 accessibility violation(s) found — 1 serious. PowerSearch - 1 issue(s)
Visual Regression1 of 420 shot(s) changed. View the report A change here is a question, not a failure: check whether the after is the
Generated by PR Enrichment workflow | Storybook | Sandbox | View full report |
There was a problem hiding this comment.
Thanks — routing through combobox rather than dropping aria-required is the right call.
One gap before it lands. DateInput implements the keyboard half of that pattern (DateInput.tsx:663 — ArrowDown and Alt+ArrowDown open the calendar); this trigger has no onKeyDown at all. So a screen-reader user hears "combobox, collapsed", presses Down Arrow because that is what the role promises, and nothing happens — where the same press on DateInput opens the picker. Enter and Space still work, so it is incompleteness rather than a break.
if (!popover.isOpen && e.key === 'ArrowDown') { e.preventDefault(); handleToggle(); }The popup here is a dialog rather than a listbox — should ArrowDown move focus into the calendar, which handleToggle already does, or keep it on the trigger the way DateInput does with skipAutoFocus?
If you would rather talk it through with a person, we are in Discord.
[Reviewed by Robohands]
| type="button" | ||
| // Select-only combobox, matching DateInput/DateTimeInput: makes | ||
| // aria-required/aria-invalid valid here (not allowed on role=button). | ||
| role="combobox" |
There was a problem hiding this comment.
The role now promises ArrowDown opens the popup; this button has no key handler.
|
Checking in on the combobox keyboard gap: Down Arrow still needs a defined open-and-focus behavior matching the announced role. Would you like to continue, have us carry it, or close this for now? |
There was a problem hiding this comment.
Thanks — exposing the trigger as a combobox (matching DateInput/DateTimeInput) is the right fix for the critical aria-required axe violation, and the baseline removal, name-pinned tests, and changeset note are clear.
One change is needed before approval: the trigger now announces "combobox, collapsed" but has no keyboard opening path. DateInput opens on ArrowDown (and Alt+ArrowDown) when closed, disabled-guarded — this trigger only handles click, so pressing Down Arrow does nothing. Please add an onKeyDown handler through the existing disabled guard (reusing the current open path), define and test where focus goes on keyboard open, and add a focused test proving aria-expanded becomes true (plus disabled/already-open cases).
Enter/Space and click still work, and no visual or prop API changes are involved.
[Automated review]
No conflicts. Auto-merged .github/a11y-baseline.json,
DateRangeInput.tsx, DateRangeInput.doc.mjs and DateRangeInput.test.tsx;
the PR's role="combobox" now sits next to upstream's
aria-required={isEffectivelyRequired ...} on the trigger.
The trigger is exposed as role="combobox" but had no keyboard path to open it besides Enter/Space. Match DateInput: ArrowDown (and Alt+ArrowDown) on the closed trigger calls the existing handleToggle and prevents the default page scroll. - F1: add handleTriggerKeyDown on the trigger. It is gated on !popover.isOpen so ArrowDown never closes an open popover, and it reuses handleToggle so the isEffectivelyDisabled guard (isDisabled, isLoading, pending changeAction) blocks it exactly like click/Enter. Doc anatomy and the changeset now mention Down Arrow. - F2: focus moves into the dialog, as it does on click. No skipAutoFocus: DateInput keeps focus in its text field so typing can continue, but this trigger is select-only. Pinned by a test asserting document.activeElement is inside the dialog after ArrowDown. - F3: tests for ArrowDown open + focus in dialog, Alt+ArrowDown, preventDefault, ArrowDown while already open, isLoading, and ArrowDown on the focusable aria-disabled (disabledMessage) trigger. The first three failed before the fix (aria-expanded stayed "false"; keydown was not default-prevented). Mutation-checked: dropping the isOpen gate fails the already-open test; bypassing handleToggle's guard fails the isLoading and disabledMessage tests.
|
Thanks @cixzhang, and sorry for the slow reply to your check-in. I'd like to continue with this one. Pushed at d16d7b6, with main merged in first (4db85f2, no conflicts;
If you'd rather keep focus on the trigger, tell me and I'll switch it. I still need to update the PR description for the Down Arrow change and fix the stale #4074 reference in "Not in this PR". |
There was a problem hiding this comment.
Thanks — this now looks ready. Exposing the trigger as a combobox (matching DateInput/DateTimeInput) is the right fix for the critical aria-required axe violation, and the baseline removal, name-pinned tests, and changeset note are clear.
The keyboard gap from the previous round is addressed: ArrowDown and Alt+ArrowDown on the closed trigger open the picker through the same disabled/loading guard as click, the page no longer scrolls on that key, focus moves into the dialog as it does on click (a sensible choice for a select-only trigger), and ArrowDown stays blocked while loading or on a disabled-with-reason trigger. The new tests cover each of those cases, including aria-expanded becoming true and focus ending up inside the dialog.
No visual or prop API changes are involved; the only consumer-facing note is the one already in the changeset — role-based queries for the trigger move from button to combobox.
[Automated review]
Upstream added two DateRangeEditor tests after this
branch started ("renders an absolute-to-now range without changing the
filter" and "renders a relative-to-now range without changing the
filter") that locate the DateRangeInput trigger with
getByRole('button', {name: /^date range:/i}). This PR intentionally
exposes that trigger as role="combobox" (matching DateInput and
DateTimeInput), so both queries failed in CI test-ui with "Unable to
find an accessible element with the role "button"". Switch the two
queries to role "combobox" with the same name matcher; each test's
intent (formatted range text, no onChange) is unchanged.
Red: 2 failed | 20 passed in PowerSearchValueEditor.test.tsx before the
change. Green: all 9 PowerSearch suites plus DateRangeInput and
useInputStatusIcon pass (11 files, 310 tests). A repo-wide search found
no other role=button query, play function, Playwright spec or a11y
baseline entry that targets this trigger.
|
Pushed 784dad1 to fix the red |
There was a problem hiding this comment.
Thanks — this now looks ready. Exposing the trigger as a combobox (matching DateInput/DateTimeInput) is the right fix for the critical aria-required axe violation, and the baseline removal, name-pinned tests, and changeset note are clear.
The keyboard gap from the previous round is addressed: ArrowDown and Alt+ArrowDown on the closed trigger open the picker through the same disabled/loading guard as click, the page no longer scrolls on that key, focus moves into the dialog as it does on click, and ArrowDown stays blocked while loading or on a disabled-with-reason trigger. The new tests cover each of those cases, including aria-expanded becoming true and focus ending up inside the dialog.
This revision also fixes the PowerSearch fallout: the two DateRangeEditor tests that landed on main querying the trigger as a button now query it as a combobox with the same name matcher and unchanged assertions.
No visual or prop API changes are involved; the only consumer-facing note is the one already in the changeset — role-based queries for the trigger move from button to combobox.
[Automated review]
There was a problem hiding this comment.
Thanks for following through on the Down Arrow behaviour; it works as described on this branch. Approval now needs an engineering owner to settle the governing spec for this addition: whether the DateRangeInput trigger adopts the combobox pattern (role, Down Arrow and Alt+Down Arrow, focus moving into the calendar) and records it in the component's spec, now that main (#7297) has fixed the same aria-allowed-attr entry by keeping the trigger a button with a hidden "Required" description. An engineering owner records that decision by commenting /approve-spec 784dad1cdc3e0f1607ef8dc6e824eebd9022ac5c on this pull request, and the author may do so if they are an engineering owner. If the combobox stays, the branch also needs a rebase, because it no longer merges cleanly into main:
DateRangeInput.tsxandDateRangeInput.test.tsxconflict, and three tests onmainstill look the trigger up as abutton.- The changeset's "so
aria-requiredis valid" no longer holds, sincemainremovedaria-requiredfrom the trigger. - The new
onKeyDownneeds to compose with a caller'sonKeyDown, the wayonClickalready does onmain.
[Automated review]
| '@astryxdesign/core': patch | ||
| --- | ||
|
|
||
| [fix] DateRangeInput: expose the trigger as `role="combobox"` (matching DateInput/DateTimeInput) so `aria-required` is valid — it is not allowed on `role=button` (axe aria-allowed-attr, critical). Tests locating the trigger via `getByRole('button', {name})` must switch to `getByRole('combobox')`. Down Arrow (and Alt+Down Arrow) on the trigger now opens the picker, matching DateInput. |
There was a problem hiding this comment.
On main, #7297 already removed aria-required from this trigger (required state is now a visually hidden description), so after a rebase this reason no longer holds. If the combobox stays, the note should describe the role and Down Arrow change and the accessibility target it serves instead.
| type="button" | ||
| // Select-only combobox, matching DateInput/DateTimeInput: makes | ||
| // aria-required/aria-invalid valid here (not allowed on role=button). | ||
| role="combobox" |
There was a problem hiding this comment.
main cleared the same axe entry in #7297 by keeping this a <button>. Whether the trigger adopts the combobox pattern is an owner decision; if it does, component:DateRangeInput needs to name the adopted parts (spec:AST-020 FR2 and FR15), as component:DateInput AR2 does for DateInput.
| // aria-required/aria-invalid valid here (not allowed on role=button). | ||
| role="combobox" | ||
| onClick={handleToggle} | ||
| onKeyDown={handleTriggerKeyDown} |
There was a problem hiding this comment.
After a rebase, main spreads caller DOM props onto this trigger and chains onClick with chainEventHandlers. This onKeyDown would replace a caller's onKeyDown; compose it the same way, component first (chainEventHandlers(handleTriggerKeyDown, onKeyDownProp)), as input-fields FR10 requires.



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.