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

Keep <Combobox /> open when clicking in scrollbar on <ComboboxOptions> #3249

Merged
merged 5 commits into from
May 28, 2024

Conversation

RobinMalfait
Copy link
Member

This PR fixes an issue where a <Combobox> would close if you click inside the scrollbar area on the <ComboboxOptions>. This is because clicking inside the scrollbar area performs a click on the element below the scrollbar (at least on macOS). If the element below is focusable, then focus will be moved there.

If focus is moved to the underlying element, then the <ComboboxInput> will blur which causes the <Combobox> will close.

This issue can be seen in #3230 where using the <Combobox> inside the <Dialog> then clicking in the scrollbar area of the <ComboboxOptions> will move the focus to the <Dialog> itself and closes the <Combobox>.

Fixes: #3230

Copy link

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

Copy link
Member

@adamwathan adamwathan left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just some writing tweaks 👍

packages/@headlessui-react/CHANGELOG.md Outdated Show resolved Hide resolved
@RobinMalfait RobinMalfait merged commit 7267cc4 into main May 28, 2024
8 checks passed
@RobinMalfait RobinMalfait deleted the fix/issue-3230 branch May 28, 2024 13:33
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.

Unable to click scrollbar of combobox options when being displayed inside a Dialog
3 participants