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

next: rename Listbox to Select and drop old select #769

Merged
merged 8 commits into from
Oct 16, 2024

Conversation

huntabyte
Copy link
Owner

@huntabyte huntabyte commented Oct 16, 2024

Select and Listbox are way too similar to be separate components. This just creates confusion, and IMO, the original implementation of Listbox is much better.

This PR replaces the entire Select implementation with the current Listbox implementation + a few additional features to handle typeahead when the trigger is focused, and the content is closed via the items prop. We've dropped the Listbox component (if you were using it before, just replace Listbox with Select and the API is the same. If you were using the Select, you'll just need to make a few minor changes to get back up and running.

Now, users don't need to use an entirely different component/API for "multi-select"; the updated Select is capable of both.

Additionally, support has been added for auto-filling responses via password managers or otherwise, if you provide the items prop and it's a type="single" Select.

Closes #753
Closes #748

Copy link

changeset-bot bot commented Oct 16, 2024

🦋 Changeset detected

Latest commit: 6b7c78c

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

This PR includes changesets to release 1 package
Name Type
bits-ui Patch

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

Copy link
Contributor

github-actions bot commented Oct 16, 2024

built with Refined Cloudflare Pages Action

⚡ Cloudflare Pages Deployment

Name Status Preview Last Commit
bits-ui ✅ Ready (View Log) Visit Preview 6b7c78c

@huntabyte huntabyte changed the title next: remove Listbox and replace Select with its impl. next: rename Listbox to Select and drop old select Oct 16, 2024
@huntabyte huntabyte merged commit 9400dfb into next Oct 16, 2024
5 checks passed
@huntabyte huntabyte deleted the next-deprecate-select branch October 16, 2024 23:35
@github-actions github-actions bot mentioned this pull request Oct 16, 2024
@tomasz13nocon
Copy link

tomasz13nocon commented Oct 17, 2024

Hey, since Select can now have type="multiple" which changes value type to string[], how would one go about doing a reusable Select component with proper types, while passing the bind:value down to bits-ui?

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.

2 participants