Skip to content

Implement multi select #3522

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 4 commits into
base: main
Choose a base branch
from

Conversation

Zach-Jaensch
Copy link

Description

closes: #1270

Implements the multiple option for Select.
image

Changes the form implementation (SelectBubbleInput) to update the option selected prop, instead of the select value prop. this is how the multiple select maintains the value, instead of having an array implementation in the select value. The single select also supports this, and as shown in the added tests, will still update the form as needed.

Externally, the prop type are more limiting then the HTMLSelectElement as it allows value to be an array on single, and string on multiple, however, react generates an error for these cases.

Internally, not have complex typing and type checks throughout the component, I've elected instead to do some basic checks and assumptions.

I added some basic tests to the Select component. Ideally I would use userEvent instead of fireEvent, however, due to the many event handlers and functions missing from jsdom, I've left the tests as very basic tests. Perhaps using vitest browser mode could help with testing the complex components like Select?

Thank you for taking a look at this PR. Any and all feedback is welcome!

Copy link

changeset-bot bot commented May 1, 2025

🦋 Changeset detected

Latest commit: b3ee588

The changes in this PR will be included in the next version bump.

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Select] Support multiple selections
1 participant