Skip to content

revert: menus no longer special-case controls placed among their rows - #7338

Merged
cixzhang merged 2 commits into
mainfrom
revert-menu-hosted-controls
Oct 11, 2026
Merged

cixzhang merged 2 commits into
mainfrom
revert-menu-hosted-controls

Conversation

@cixzhang

Copy link
Copy Markdown
Contributor

User impact

Screen-reader users are told they're in a menu, then run into a text field and a button that aren't menu items. #7309 made that structure work from the keyboard instead of fixing it. This revert takes it out before it ships in a release, so nothing published ever depended on it.

What this removes

All of #7309, unreleased:

  • The hosted-control key handling in DropdownMenu, ContextMenu and the sub-menu flyout: printable keys, Enter/Space, the caret guard, and Left in a flyout field.
  • The HostedField story, its unit tests, and the real-Chromium spec.
  • The "hosted" requirement and verification rows it added to FR12 in component:DropdownMenu and FR8 in component:ContextMenu. Both records are drafts, and the rows were never owner-approved.
  • Its pending changeset.

Why

Owner ruling, @cixzhang: a menu holds only menu items. role="menu" admits menuitem, menuitemcheckbox, menuitemradio, groups and separators. A control that belongs beside a menu's rows goes outside the role="menu" element, where the menu's key and press handling never claims it. A header/footer region on DropdownMenu for exactly that case follows in its own PR.

#7305, the pointer counterpart of the same pattern, has a change request on the same ruling.

Evidence

  • A clean git revert of the merge commit. Nothing merged since depends on its helpers; isTextEntry in Dialog.tsx is an unrelated local.
  • DropdownMenu, ContextMenu, useMenuPress and useListFocus suites: 323 passed. Core type-check clean. pnpm check:knowledge aligned.

Scope

  • One change: removes an unreleased behavior.
  • No public API or default changes; the changeset it removes was never published.
  • Public text and artifacts contain no internal Meta context.

Reverts #7309 before it ships. A menu holds only menu items: role="menu"
admits menuitem, menuitemcheckbox, menuitemradio, groups and separators, so
a text field or button placed among the rows is invalid structure. Teaching
the menus' key handling to step aside for those controls made that structure
work instead of fixing it.

Removes the hosted-control key handling from DropdownMenu, ContextMenu and
the sub-menu flyout, the HostedField story and its tests, the FR12 and FR8
rows it added to the DropdownMenu and ContextMenu records, and its pending
changeset. Unreleased, so no caller is affected. Controls that belong beside
a menu's rows go outside the role="menu" element; a header/footer region for
that follows separately.

Original change by vjeux.
@vercel

vercel Bot commented Oct 11, 2026 •

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated
astryx Ready Ready Preview Oct 11, 2026 6:21pm UTC

Request Review

@meta-cla meta-cla Bot added the CLA Signed This label is managed by the Meta Open Source bot. label Oct 11, 2026
@cixzhang

Copy link
Copy Markdown
Contributor Author

/approve-spec 7f3e553

@cixzhang
cixzhang enabled auto-merge (squash) October 11, 2026 18:08
@astracat-bot

astracat-bot Bot commented Oct 11, 2026 •

Copy link
Copy Markdown
Contributor

AI review status for this pull request.

Review status Updated
⏳ Queued (for maintainers only) Oct 11, 2026, 6:41 PM UTC

@github-actions

github-actions Bot commented Oct 11, 2026 •

Copy link
Copy Markdown
Contributor

PR Analysis Report

Previews ready: Storybook and Sandbox were built with this PR's docsite. CI evidence will be added when available.

View Storybook for this PR · View Sandbox for this PR

@cixzhang

Copy link
Copy Markdown
Contributor Author

/approve-spec af1e7da

This branch was successfully deployed

1 active deployment
Preview — af1e7da5 Deployed Oct 11, 2026 by vercel[bot]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

CLA Signed This label is managed by the Meta Open Source bot.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant