Repository navigation
fix(DropdownMenu): a popover with a header or footer is a modal dialog, and Tab wraps - #7515
Conversation
…g, and Tab wraps A popover that holds a menu and controls that are not menu items is not a menu: the trigger said aria-haspopup="menu", and a screen reader then met a field or a button it was not promised. With header or footer the popover is now a named role="dialog" with aria-modal, holding the header, the role="menu" element and the footer. The trigger says aria-haspopup="dialog" and its aria-controls names the popover, as Popover's own trigger does. Tab and Shift+Tab now wrap through the header's controls, the menu as one stop, and the footer's controls, as the APG Dialog pattern requires, instead of closing the menu at either end. Hidden controls are skipped. From an open sub-menu the flyout closes and focus continues from the menu's stop. With no other stop, focus stays in the menu. Escape still closes and returns focus to the trigger. A menu without either prop is unchanged: no dialog, aria-haspopup="menu", Tab closes. component:DropdownMenu gains AR5 (APG Dialog required parts) and DEC-10, decided by cixzhang on 2026-10-13. FR15, AR4's carve-out, the concept row and DEC-8's Tab sentence follow it. Unit and Chromium cases are updated to the wrap, with new cases for the dialog role and the trigger wiring.
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
|
AI review status for this pull request.
|
PR Analysis Report📚 Storybook Preview🧪 Sandbox PreviewNo new or modified components detected. Bundle Size Summary
Accessibility AuditStatus: No accessibility violations detected. Visual Regression44 of 448 shot(s) changed. A change here is a question, not a failure: check whether the after is the
and 24 more. Generated by PR Enrichment workflow | Storybook | Sandbox | View full report |
…ialog popup The trigger of a menu with a header or footer now says aria-haspopup="dialog", so the spec's trigger locator no longer matched and every case timed out. Run in Chrome 155 against the CI Storybook build of a81616c (the component is unchanged since): 10 passed.
|
/approve-spec 8807621 |
There was a problem hiding this comment.
Approval of this pull request waits on the record owner approving the draft component:DropdownMenu requirements it adds (DEC-10, AR5, the rewritten FR15 and the AR4 carve-out), including which element the trigger's aria-controls should name. The implementation matches that proposal, and its unit and Chromium tests pass. Independently of that decision, please address these points:
- The stated screen-reader outcome (what the trigger announces, and
aria-modalkeeping the reader inside the popover) needs the real assistive-technology check AST-009 asks for on NVDA with Chrome and VoiceOver with Safari, or the claim narrowed to what the browser exposes. - The changeset says
[fix], but this replaces the Tab-closes behavior documented since 0.7.0, which AST-017 FR5 and FR33 treat as a contract change for the owner to classify rather than a fix. - DEC-10, AR5 and the changeset say
aria-controlsnames the dialog, while FR15 and the code point it at the popover element that holds the dialog. - A
renderTriggermenu with a header or footer and noaria-labellogs Popover's unnamed-dialog warning at mount, although the open dialog is named.
[Automated review]
| 'aria-haspopup': hasRegions ? 'dialog' : 'menu', | ||
| 'aria-expanded': isOpen, | ||
| 'aria-controls': menuId, | ||
| 'aria-controls': hasRegions ? popover.id : menuId, |
There was a problem hiding this comment.
popover.id is the id of the [popover] element; the role="dialog" element is its child and has no id, so aria-controls names the container rather than the dialog. DEC-10, AR5 and the changeset say it names the dialog, while FR15 says the popover that holds it. Either give the dialog element an id and use it here and at line 1532, or align DEC-10, AR5 and the changeset with FR15.
| // either, the popover holds controls that are not menu items, so it is a | ||
| // modal dialog named like the menu, with the menu inside it. | ||
| role: hasRegions ? 'dialog' : 'none', | ||
| dialogLabel: hasRegions ? menuLabel : undefined, |
There was a problem hiding this comment.
With renderTrigger, a header or footer and no aria-label, menuLabel is triggerName, which is undefined until the first open, so Popover's dev check warns at mount that the dialog is unnamed and suggests role: "none", although the open dialog is named. Resolving the name before the wrapper becomes a dialog, or labelling it by the trigger's id as the inner menu is, avoids the false warning; a renderTrigger plus header test would pin it.
| '@astryxdesign/core': patch | ||
| --- | ||
|
|
||
| [fix] A `DropdownMenu` with `header` or `footer` is now a modal dialog around its menu, as the APG Dialog pattern requires. The popover is a named `role="dialog"` with the `role="menu"` inside it, and the trigger says `aria-haspopup="dialog"` and points at the dialog. Tab and Shift+Tab wrap through the header, the menu and the footer instead of closing the menu at either end. Escape still closes and returns focus to the trigger. A menu without either prop is unchanged. |
There was a problem hiding this comment.
This replaces 0.7.0 behavior: Tab past either end closes the menu, as the consumer docs describe, and the trigger says aria-haspopup="menu". AST-017 FR5 says a proposal that intentionally replaces a documented contract is not a fix, and FR33 makes it the owner's contract decision, so it needs classifying under FR1 and FR32 once the owner decides: [breaking] if a valid consumer relies on the old behavior, which FR31 keeps out of the declared patch, and otherwise not [fix].
…ign the dialog wording A renderTrigger menu with a header or footer and no aria-label logged Popover's unnamed-dialog warning at mount, because the trigger's name was read only when the menu opened. The name is now read once the trigger mounts, and the popover takes the dialog role only once it has a name. DEC-10, AR5 and the changeset now say what FR15 and the code do: aria-controls names the popover that holds the dialog, as Popover's own trigger does. Their wording also stops at what the browser exposes (role, name, aria-modal, aria-haspopup), which the accessibility-tree assertions prove, instead of claiming what a screen reader announces.
There was a problem hiding this comment.
Approval waits on the record owner confirming the reworded DEC-10 and AR5, which now point the trigger's aria-controls at the popover element that holds the dialog rather than at the dialog itself; the other dialog and Tab-wrap requirements match what the owner approved, and the unit and Chromium tests pass. Independently of that decision, please address these points:
- The changeset says
[fix], but this replaces the Tab-closes behavior andaria-haspopup="menu"documented in 0.7.0, which AST-017 FR5 and FR33 treat as a contract change to classify under FR1 rather than a fix. - A
renderTriggercontrol whose name comes from an inner image orsvglabel (an icon-only button, say) still saysaria-haspopup="dialog", but the popover never gets its dialog role. - The new layout effect that reads a custom trigger's name should say what it synchronizes from, as INV3 of the React component runtime record requires.
[Automated review]
| '@astryxdesign/core': patch | ||
| --- | ||
|
|
||
| [fix] A `DropdownMenu` with `header` or `footer` is now exposed as a modal dialog around its menu, as the APG Dialog pattern requires. The popover is a named `role="dialog"` with `aria-modal` and the `role="menu"` inside it; the trigger says `aria-haspopup="dialog"` and its `aria-controls` names the popover holding the dialog. Tab and Shift+Tab wrap through the header, the menu and the footer instead of closing the menu at either end. Escape still closes and returns focus to the trigger. A menu without either prop is unchanged. |
There was a problem hiding this comment.
This replaces behavior documented in 0.7.0: Tab past either end closes the menu, and the trigger says aria-haspopup="menu". AST-017 FR5 says a proposal that intentionally replaces a documented contract is not a fix, and FR33 makes it the owner's contract decision. Please classify it under FR1: if a valid 0.7.x consumer relies on the old Tab behavior or on aria-haspopup="menu" from such a trigger (this PR's own Chromium locator did), it is [breaking], which FR31 keeps out of the declared 0.7.1 patch.
| // modal dialog named like the menu, with the menu inside it. A custom | ||
| // trigger's name is read off the control once it mounts, so the dialog | ||
| // role waits for that name rather than rendering an unnamed dialog. | ||
| role: hasRegions && menuLabel != null ? 'dialog' : 'none', |
There was a problem hiding this comment.
The dialog role waits for menuLabel, but aria-haspopup (lines 1490 and 1540) says dialog whenever a header or footer renders. With a renderTrigger control named by content readAccessibleName cannot read, such as an icon-only button with an inner svg label or img alt, and no aria-label, the trigger advertises a dialog and no role="dialog" ever renders. Naming the dialog by reference to the trigger, as the menu already is through aria-labelledby, would let the role render without waiting on a string; otherwise keep the role and warn in development when no name can be read, and add a test for an icon-only custom trigger.
| // With a header or footer the dialog is named like the menu, so a custom | ||
| // trigger's name is needed before the first open, not only at it. |
There was a problem hiding this comment.
This effect sets state from the DOM, but its comment does not name what it synchronizes, which INV3 of the React component runtime record asks of a new effect. Saying that it reads the mounted control's accessible name, which render cannot know, is enough; naming the dialog by reference to the trigger would remove the effect altogether.
|
/approve-spec c5d6b1d |
…e and name A renderTrigger control named by an inner image, label or svg title read as nameless, so with a header or footer the trigger said aria-haspopup="dialog" while the popover never took the dialog role. The name read from a control's contents now includes an image's alt, an inner aria-label and an svg title. With regions the popover is always a dialog, named by the menu's name or, when none can be read, the default menu label. The layout effect that reads the trigger's name now states what it synchronizes from (the rendered control's DOM), per the runtime record's INV3.
|
/approve-spec 3b1fe7d |
An svg title already reads through textContent, so the case did not tell the fix from the old code. An image's alt does: both new cases fail without the fix and pass with it.
|
/approve-spec aac9b60 |
There was a problem hiding this comment.
Approval waits on a maintainer landing the AST-017 amendment in #7523: the [fix] patch changeset follows the decision that accessibility behavior fixes are not breaking, but AST-017 on main still says a change that intentionally replaces documented behavior is not a fix (FR5, FR33). The dialog semantics, trigger wiring and Tab wrap match the approved DropdownMenu record, and the unit and Chromium tests pass. Independently, please give the dialog the trigger's name when a custom trigger is named by its own <label> or an input button's value; today it falls back to "Menu" while the menu is named by the control, unlike FR15's "named like the menu".
[Automated review]
| // menu label, so it is never unnamed and never loses its role. | ||
| role: hasRegions ? 'dialog' : 'none', | ||
| dialogLabel: hasRegions | ||
| ? (menuLabel ?? t(DEFAULT_BUTTON_I18N_KEY)) |
There was a problem hiding this comment.
When readAccessibleName cannot read the custom trigger's name, the dialog becomes "Menu" even if the browser names the control: an <input type="button" value="Labels"> trigger, or a button named by a <label for>, leaves the trigger and the inner menu named "Labels" and the dialog "Menu". FR15 says the dialog is "named like the menu". Reading the control's own labels and an input button's value in readAccessibleName would close the gap; a case for each would pin it.
| '@astryxdesign/core': patch | ||
| --- | ||
|
|
||
| [fix] A `DropdownMenu` with `header` or `footer` is now exposed as a modal dialog around its menu, as the APG Dialog pattern requires. The popover is a named `role="dialog"` with `aria-modal` and the `role="menu"` inside it; the trigger says `aria-haspopup="dialog"` and its `aria-controls` names the popover holding the dialog. Tab and Shift+Tab wrap through the header, the menu and the footer instead of closing the menu at either end. Escape still closes and returns focus to the trigger. A menu without either prop is unchanged. |
There was a problem hiding this comment.
This [fix] patch declaration follows the owner's decision that accessibility behavior fixes are not breaking, which #7523 writes into AST-017 (now as FR53 and DEC-20). Until that amendment is on main, AST-017 FR5 still says "A proposal that intentionally replaces the documented contract is not a fix", so approval waits for it; no change is needed here once it lands.
…or input value A renderTrigger control named by its own <label> or, for an input button, by its value left the dialog on the default label while the menu itself was named by the control, unlike FR15's "named like the menu". The name read from the trigger now includes its labels and an input button's value. Both cases are tested and fail without the fix.
|
/approve-spec 15367ed |
There was a problem hiding this comment.
Approval waits on a maintainer landing the AST-017 amendment in #7523 on main: the [fix] patch changeset follows the owner's decision that accessibility behavior fixes are not breaking, but AST-017 on main still says a change that intentionally replaces documented behavior is not a fix (FR5, FR33). The dialog semantics, trigger wiring, Tab wrap and custom-trigger naming match the approved DropdownMenu record, and the unit and Chromium tests pass, so nothing else needs to change here once that amendment is current.
[Automated review]
## Exact decision needed Whether a change that makes a released component meet its accessibility target, and in doing so replaces documented interaction or accessibility behavior, is a breaking change. ## Existing authority searched - `spec:AST-017`: - FR3 puts documented interaction and accessibility behavior inside the compatibility promise. - FR5 says a proposal that intentionally replaces the documented contract is not a fix. - FR32–FR34 classify a correction with a released victim as `[breaking]`, held for a planned minor or shipped behind an opt-in in a patch. - Together these send every accessibility conformance fix that changes documented behavior to the next minor. - `spec:AST-020`: owns the accessibility targets (WCAG 2.2 A/AA in FR1; APG pattern adoption in FR15). It says nothing about release classification. - `spec:AST-009`: owns real-AT evidence. Not about classification. - Overlapping open work: #7444 and #7445 also edit AST-017, in unrelated sections (codemod evidence, successor plan). - Prompting change: #7515 replaces DropdownMenu's 0.7.0 Tab behavior to meet the APG Dialog pattern. ## Decision `spec:AST-017/DEC-20`, decided by @cixzhang on 2026-10-14: accessibility behavior fixes are not breaking. Her words that day: - 08:18 PT: "Accessibility behavior fixes are not breaking" - 08:20 PT: "Yeah go ahead and amend ast017" - 08:33 PT: "Yeah accessibility fixes are patches" - 08:34 PT: "Accessibility fixes should always be internal" and "I don't think it should ever change app layer code" - 08:34:58 PT: "Adding a new prop is not breaking either though" The rule: - **FR53 (new):** a change whose purpose is to make a released component meet its accessibility target is `[fix]` and patch-eligible, with no deprecation or coexistence path, even when it replaces documented roles, accessible names, states and properties, focus movement or keyboard behavior. The target is: - a WCAG 2.2 Level A or AA success criterion, - the required parts of an APG pattern the component adopts under AST-020 FR15, or - a current accessibility requirement in its record. - **No app-layer code change:** existing props, types, exports, tokens and documented usage keep working unchanged. - It may add optional public surface, such as a new optional prop. That is not breaking, and the addition is admitted under AST-017's existing rules for public additions. - It never removes, renames, or narrows existing surface. - A change that would make apps edit code is redesigned so the component absorbs it, or it is classified under FR1. - **Release note:** the Changeset names the old and new behavior and the accessibility target, so a documented behavior change gets a release-note line. - **How additive surface is admitted:** spec and API review, and its patch-or-minor handling, are left to the existing AST-017 rules. - **FR3, FR5, FR25, FR32, FR33** point to FR53. FR33 names the accessibility target as the authority for such a fix. - **Review routing:** the record's `review-applicability` block lists FR53 and DEC-20 under compatibility. - **Verification:** an FR53 row with all four cells. **IDs:** main ends at FR51 and DEC-18. Open AST-017 changes claim FR52 (#7444) and DEC-19 (#7444 and #7445 both). This change takes **FR53** and **DEC-20**; no open change claims either. The gap at FR52 is fine (AST-029 already has one). ## Rejected alternatives - Classifying accessibility corrections as breaking whenever a released caller observes the old behavior. That delays every conformance fix to a minor and keeps the harm in place meanwhile. ## Claim scope and non-goals - Governs release classification of accessibility conformance changes only. - Does not decide what any component's accessible behavior is. That stays with AST-020 and the component records. - Does not change visual-only classification (DEC-17), emergency correction (FR35), or the patch/minor gate for other breaking changes. ## Evidence and implementation relationship No implementation. #7515 is the first change classified under this rule. ## Writing rubric results - R1 narration: none. FR53 and DEC-20 state the rule in the present tense. The "replaces" wording describes the class of change the rule covers, not this PR's history. - R2 research in the record: none. - R3 evidence naming a change: none. The FR53 verification row names review and the component record's evidence. - R4 rejected alternatives over one line or outside a decision: one, one line, inside DEC-20. - R5 pull request or issue references remaining: none in the record. - R6 ruled open questions still listing options: none. Open questions stay "None." ## Scope - [x] This PR contains specification records only. - [x] It records observable behavior and preserves equivalent internal implementations. - [x] Any named internal mechanism is intentionally public, names its dependent caller/system, and explains why an equivalent implementation would not satisfy the contract. - [x] Verification states the evidence layer and failure signal without prescribing CI job/workflow topology. - [x] It records one intentional durable decision, not a rescue for a separable tagalong. - [x] The canonical knowledge owner, affected current claims, and overlapping open work are named; any ownership collision is resolved or called out for human decision. - [x] Adjacent API, visual, accessibility, composition, and implementation facts remain outside scope unless this exact decision depends on them. - [x] Public text and artifacts contain no internal Meta context. ## Validation - `pnpm check:knowledge`: aligned - Prettier: applied - `git diff --check`: clean
|
/approve-spec bc82d10 |
There was a problem hiding this comment.
Changes requested for one keyboard fix; the dialog semantics, trigger wiring and Tab wrap match the approved DropdownMenu record, and the [fix] patch classification now matches AST-017 FR53 on main. The new Tab cycle treats each radio of a native group in the header or footer (a RadioList, for example) as its own Tab stop, so Tab walks every option and Shift+Tab from the menu lands on the last, unchecked one, while browsers and RadioList give the group a single stop at the checked radio. Collapsing each same-name radio group in the cycle to its checked radio (the first or last radio by direction when none is checked) and adding a header radio-group test would resolve it; nothing else needs to change.
[Automated review]
| } | ||
| e.preventDefault(); | ||
| e.stopPropagation(); | ||
| const cycle = [ |
There was a problem hiding this comment.
This cycle takes every focusable radio from tabbablesIn, so a native radio group in the header or footer (a RadioList, say) becomes one Tab stop per option, and Shift+Tab from the menu enters it on the last, unchecked radio. Browsers and RadioList give a same-name group a single stop at its checked radio. Collapsing each group here to its checked radio (first or last by direction when none is checked), with a header radio-group test, would match that.
The dialog's Tab cycle treated each radio of a native group as its own stop, so Tab walked every option and Shift+Tab from the menu landed on the last, unchecked one. The cycle now collapses each named radio group to the stop a browser gives it: the focused radio, else the checked one, else the first moving forward or the last moving backward. Header radio-group tests cover the checked and unchecked cases; the checked cases fail without the fix.
|
/approve-spec 275a377 |
There was a problem hiding this comment.
This looks ready to approve: the dialog semantics, trigger wiring and Tab wrap match the owner-approved DropdownMenu record, and the [fix] patch classification matches the accessibility-fix rule in AST-017. The radio-group Tab stop raised on the previous revision is fixed: a same-name group in the header or footer is now a single stop in both directions, as a Chromium check of this revision and the new unit cases confirm. Nothing else needs to change.
[Automated review]
User impact
A
DropdownMenuwith aheaderorfooterexposedaria-haspopup="menu"on its trigger, and its popover then held a filter field or a "Create" button that isn't a menu item. Keyboard users who Tabbed past either end found the popover closed out from under them.Now the popover is exposed as a named modal dialog with the menu inside it. The trigger exposes
aria-haspopup="dialog", and Tab cycles through the header, the menu and the footer until Escape or a press outside closes it. A menu without either prop is unchanged.What changes
role="dialog"witharia-modal="true", named like the menu. It holds the header, therole="menu"element (rows only) and the footer.aria-haspopup="dialog", andaria-controlsnames the popover that holds the dialog, the same convention Popover's own trigger uses. A custom trigger's name is read once it mounts, so the dialog is never unnamed.headerorfooter, which keepsaria-haspopup="menu"and closes on Tab.Current specification
component:DropdownMenu(draft):spec:AST-020/FR15.This fixes behavior shipped in 0.7.0 (#7344).
Compatibility
Classified
[fix]underspec:AST-017/FR53and DEC-20 (#7523), owner decision by @cixzhang on 2026-10-14: accessibility behavior fixes are not breaking.DropdownMenuTriggerPropsalready typedaria-haspopupas'menu' | 'dialog'; no prop, callback signature, ref target or export changes;onOpenChangestill reports every close; documented composition (header,footer, rows as children) is unchanged.onOpenChange(false)no longer fires on that Tab; the trigger exposesaria-haspopup="dialog"andaria-controlsnames the popover.aria-haspopup="menu"on a header/footer menu would see the new behavior; no runtime code needs to change.Writing rubric results
Evidence
Scope of the accessibility claim: it ends at what the browser exposes (role, name,
aria-modal,aria-haspopup), proved by accessibility-tree assertions in Chromium (AST-009 FR3). No NVDA or VoiceOver run was made, so nothing here claims what a screen reader announces.DropdownMenu.test.tsx, header and footer suite, 26 cases: two new ones for the dialog role and trigger wiring with and without regions, and the end-of-Tab and hidden-control cases rewritten from close to wrap.MenuHeaderFooter.a11y.chromium.spec.ts: the Tab walk now asserts the wrap at both ends, and a new case checks the dialog role,aria-modal, its name, the menu and regions inside it, and that the trigger'saria-controlsholds the dialog. It runs inpr-a11y.DropdownMenu, ContextMenu, Breadcrumbs, Popover, BottomSheet, focus-trap and doc-prop suites: 689 passed. Types and lint clean;
check:knowledgeandcheck:changesetspass.Scope