Skip to content
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

Autocomplete component (Multiple Selection) #1857

Conversation

amauryfischer
Copy link

📝 Description

Add support for multiple selection via selectionMode "single" or "multiple" to the autocomplete component.

⛳️ Current behavior (updates)

The current behavior only allows single selection. This is because react-stately uses useComboStateProps, which only allows for single selection. The "multi" version in react-stately doesn't seem to be a complete project: adobe/react-spectrum#2140.
What I propose is to create a new hook called "useMultiComboBoxState" and tweak the original behavior to allow for both multiple and single selection.

🚀 New behavior

Allow the user to select multiple elements using selectionMode.

💣 Is this a breaking change (Yes/No):

No

📝 Additional Information

This is a work in progress. Since this is my first PR, please don't hesitate to guide me through the coding and/or style.

Update type definitions. Ensure correct autocomplete rendering for multiple selections.
Copy link

changeset-bot bot commented Nov 3, 2023

⚠️ No Changeset found

Latest commit: 333ec0e

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

Copy link

vercel bot commented Nov 3, 2023

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
nextui-storybook-v2 ✅ Ready (Inspect) Visit Preview 💬 Add feedback Nov 3, 2023 4:15pm

Copy link

vercel bot commented Nov 3, 2023

@amauryfischer is attempting to deploy a commit to the NextUI Team on Vercel.

A member of the Team first needs to authorize it.

@amauryfischer
Copy link
Author

@jrgarciadev Sorry i'm not sure how i'm supposed to commit on the new branch you created, so i just forked again and created a new PR on you're newly created branch....

Update autocomplete to add a slot for tagContainer and add css for tw variants
Fixing multicombo case where single selection was still applied and update a bit of TS
@amauryfischer amauryfischer changed the title feat: refine multi-combobox TypeScript Autocomplete with multiple selection behaviour Nov 3, 2023
@amauryfischer amauryfischer changed the title Autocomplete with multiple selection behaviour Autocomplete component (Multiple Selection) Nov 3, 2023
@luckLs
Copy link

luckLs commented Dec 25, 2023

可以支持多选了不

@hackr-sh
Copy link

Is this planning on being merged?

@Elfari1028
Copy link

! would love to see this get merged

@wingkwong
Copy link
Member

Closing due to inactivity.

@wingkwong wingkwong closed this Apr 21, 2024
@impact-ls
Copy link

Not that many changes there, any hope for adding this soon?

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.

6 participants