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

Ensure the multiple prop is typed correctly when passing explicit types to the Combobox component #3099

Merged
merged 2 commits into from
Apr 15, 2024

Conversation

RobinMalfait
Copy link
Member

@RobinMalfait RobinMalfait commented Apr 14, 2024

This PR fixes an issue where defining the types of the Combobox component explicitly made the type of the multiple prop incorrect (it defaulted to true).

E.g.:

<Combobox<{ id: number, name: string }> />

This eventually became the following type:

{ id: number, name: string }[]

... which is incorrect.

…bobox`

When you use the `Combobox` component with explicit types:

```ts
<Combobox<MyType> />
```

Then we make sure that we properly set the `TMultiple` prop as well. It
defaults to `false` which seems to be the better default.
Copy link

vercel bot commented Apr 14, 2024

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

Name Status Preview Comments Updated (UTC)
headlessui-react ✅ Ready (Inspect) Visit Preview 💬 Add feedback Apr 14, 2024 1:29pm
headlessui-vue ✅ Ready (Inspect) Visit Preview 💬 Add feedback Apr 14, 2024 1:29pm

@RobinMalfait RobinMalfait merged commit 512bf44 into main Apr 15, 2024
8 checks passed
@RobinMalfait RobinMalfait deleted the fix/explicit-combobox-type branch April 15, 2024 15:43
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