Skip to content

Fix cfpb-select multiple toggle state - #2718

Open
arpitjain099 wants to merge 1 commit into
cfpb:mainfrom
arpitjain099:fix/select-multiple-toggle-2609
Open

Fix cfpb-select multiple toggle state#2718
arpitjain099 wants to merge 1 commit into
cfpb:mainfrom
arpitjain099:fix/select-multiple-toggle-2609

Conversation

@arpitjain099

@arpitjain099 arpitjain099 commented Jun 18, 2026

Copy link
Copy Markdown

When cfpb-select switches from multiple back to single mode, it can keep more than one option checked.

This normalizes the selection down to one option (the most recent checked value) and updates the single-select label to match. I also added a regression test that covers the toggle path.

Tested locally with:

  • npx -y @yarnpkg/cli-dist@4.16.0 eslint packages/cfpb-design-system/src/elements/cfpb-select/index.js packages/cfpb-design-system/src/elements/cfpb-select/index.spec.js
  • npx -y @yarnpkg/cli-dist@4.16.0 vitest run packages/cfpb-design-system/src/elements/cfpb-select/index.spec.js packages/cfpb-design-system/src/elements/cfpb-select/multiple-select-event-proxy.spec.js
  • npx -y @yarnpkg/cli-dist@4.16.0 vite build --config vite.config.packages.js

Fixes #2609

Signed-off-by: Arpit Jain <arpitjain099@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: No status

Development

Successfully merging this pull request may close these issues.

When single select multiple attribute is added and removed, it's possible to get a single select with multiple selections.

1 participant