headlessui
headlessui copied to clipboard
[Bug]: Combobox breaks when selecting a value using the keyboard
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?
All
Reproduction URL
https://stackblitz.com/edit/vitejs-vite-coiqswwa?file=src%2FApp.jsx
Describe your issue
When selecting a value using the mouse, the combobox functions as expected. However, if a value is selected using the keyboard (via the Enter key), the programmatic reset no longer works as intended.
https://github.com/user-attachments/assets/e679d996-f3f0-4a23-8f68-fe5525a70161
Thank you for your work! We find your library very convenient.
I can resolve this issue on my own if you help me review my PR. Thanks!
This should be fixed by #3785, and will be available in the next release.
You can already try it using:
npm install @headlessui/react@insiders.