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 clicking a ComboboxOption after filtering the options, correctly triggers a change #3180

Merged
merged 8 commits into from May 7, 2024

Conversation

RobinMalfait
Copy link
Collaborator

This PR fixes an issue where typing into a Combobox (filtering), and then clicking an option doesn't correctly choose the option.

We also made sure that the ComboboxInput stays focused after selecting an option (even when clicking).

Fixes: #3178

Copy link

vercel bot commented May 7, 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 May 7, 2024 2:46pm
headlessui-vue ✅ Ready (Inspect) Visit Preview 💬 Add feedback May 7, 2024 2:46pm

@RobinMalfait RobinMalfait changed the title Ensure clicking a ComboboxOption correctly triggers a change Ensure clicking a ComboboxOption after filtering the options, correctly triggers a change May 7, 2024
@RobinMalfait RobinMalfait merged commit 886fdf7 into main May 7, 2024
8 checks passed
@RobinMalfait RobinMalfait deleted the fix/issue-3178 branch May 7, 2024 14:49
RobinMalfait added a commit that referenced this pull request May 8, 2024
…ctly triggers a change (#3180)

* add mouse buttons

* add `useDisposables` hook

* add `useFrameDebounce` hook

Schedule a task in the next frame

* ensure we reset the `isTyping` flag correctly

* use same `mousedown` API as we did in React

This allows us to never leave the `input`, even when clicking on an
option.

* update changelog

* format comments

* inline `cb`
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.

Combobox: after searching and clicking on a list item, the input value is not updated
2 participants