headlessui icon indicating copy to clipboard operation
headlessui copied to clipboard

React Combobox v2 type definitions don't support "by" prop in uncontrolled usage

Open silvenon opened this issue 9 months ago • 0 comments

What package within Headless UI are you using?

@headlessui/react

What version of that package are you using?

v2.2.0

What browser are you using?

N/A

Reproduction URL

https://stackblitz.com/edit/vitejs-vite-7mbtsold?file=src%2FApp.tsx

Describe your issue

In the Combobox React component the by prop is only permitted by TypeScript definitions if value is also provided, which doesn't allow for the uncontrolled usage. This was possible in v1, I'm not sure if by mistake or not.

Considering that onChange is a prop that will be most likely used on Combobox, how about removing NoInfer from the argument of that function?

silvenon avatar Feb 07 '25 10:02 silvenon