Support dynamic labels for multiple variant ActionMenu - #465
Conversation
🦋 Changeset detectedLatest commit: c4f008c 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 |
ActionMenu
|
Uh oh! @myabc, at least one image you shared is missing helpful alt text. Check your pull request body to fix the following violations:
Alt text is an invisible description that helps screen readers describe images to blind or low-vision users. If you are using markdown to display images, add your alt text inside the brackets of the markdown image. Learn more about alt text at Basic writing and formatting syntax: images on GitHub Docs.
|
4de98c3 to
0f57fd3
Compare
There was a problem hiding this comment.
Pull request overview
This PR extends Primer::Alpha::ActionMenu dynamic-label behavior to the multiple-select variant, so the invoker button label reflects all currently selected items (including preselected ones). This aligns ActionMenu behavior more closely with other selection components (e.g., SelectPanel) and addresses the linked accessibility issue.
Changes:
- Update ActionMenu custom element logic to compute and render dynamic labels for
data-select-variant="multiple". - Add/adjust system coverage for dynamic labels in both single- and multiple-select ActionMenu previews.
- Add a changeset documenting the user-facing enhancement.
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 3 comments.
| File | Description |
|---|---|
| test/system/alpha/action_menu_test.rb | Renames the single-select dynamic label test and adds a multiple-select dynamic label test (but leaves an older now-contradictory assertion in the file). |
| app/components/primer/alpha/action_menu/action_menu_element.ts | Updates #setDynamicLabel() to support multi-select by joining checked item labels and calling it after multi-select toggles. |
| .changeset/sweet-candies-pay.md | Declares a minor release for adding multi-select dynamic label support. |
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Note
This PR was recreated for the OPF fork from #465
What are you trying to accomplish?
Screenshots
Integration
List the issues that this change affects.
Closes primer#3826
Risk Assessment
What approach did you choose and why?
Anything you want to highlight for special attention from reviewers?
Accessibility
Merge checklist
Take a look at the What we look for in reviews section of the contributing guidelines for more information on how we review PRs.