Repository navigation
Conversation
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
🦋 Changeset detectedLatest commit: 21ee8c6 The changes in this PR will be included in the next version bump. This PR includes changesets to release 1 package
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
|
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Copilot-Session: 23a42dde-c59d-4f5a-97ca-4fa6f7c41164
There was a problem hiding this comment.
🟡 Changes recommended
With native CSS anchor positioning enabled, first-open focus can enter the menu before its accessible label is available.
1 open issue
What changed in this PR
This PR addresses #8608 by avoiding label-state updates when closed ActionMenus mount, with regression coverage for labeling and focus behavior.
Changes:
- Restricts trigger-label capture to a passive effect while the menu is open.
- Adds closed-mount render-count, controlled-labeling, and close/focus tests.
- Adds a patch changeset for
@primer/react.
| File | Description |
|---|---|
packages/react/src/ActionMenu/ActionMenu.tsx |
Gates trigger-label updates on the open state. |
packages/react/src/ActionMenu/ActionMenu.test.tsx |
Adds render-count, labeling, and focus regression coverage. |
.changeset/quiet-action-menu-labels.md |
Documents the closed-mount rendering improvement. |
Review effort: Balanced
|

Closes #8608
Moves ActionMenu trigger-label capture out of passive effects and into the open interaction, where React batches it with the existing open update. This avoids an extra commit when closed menus mount while preserving the accessible name on first open.
Adds focused regression coverage for closed-mount render count, first-open labeling, Escape, Tab, selection, and focus restoration. No visual changes are expected.
Changelog
New
Changed
Removed
Rollout strategy
Testing & Reviewing
npm test -- packages/react/src/ActionMenu/ActionMenu.test.tsx— passed (59 tests)npm run build— passednpm test— passed (160 files; 2,902 passed, 3 skipped, 10 todo)npm run type-check— passednpm run lint— passednpm run lint:css— passednpm run format:diff— passedSTORYBOOK_URL=http://localhost:6006 npx playwright test --grep @avt— passed (8 tests)Review the focused tests for the first-open accessible name and the different close/focus paths. The mount profiler assertion should remain at zero update commits after effects flush.