-
-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Description
What package within Headless UI are you using?
@headlessui/react
What version of that package are you using?
v2.2.4
What browser are you using?
Chrome
Reproduction URL
This bug is easy to see in Catalyst when using Mobile Chrome on Android or when in Mobile viewer for chrome dev tools.
https://catalyst.tailwindui.com/docs/listbox.
Describe your issue
Attempt to open the listbox in mobile Chrome. Let your click be just a tiny big sluggish (> 100ms). The listbox will close immediately, preventing the user from making a selection. See video below
CleanShot.2025-06-25.at.11.12.06.mp4
Headless UI recently started using the pointerdown event for ListboxButton instead of the click event. On mobile chrome, this now results in the following sequence
- User Begins Click
- ListboxButton receives pointerdown event
- ListboxOptions opens
- User Finishes Click
- ListboxOption receives click event
- ListboxOptions closes
This all happens in the space of 100ms or so and in a single user tap.
This bug affects any mobile ui where the ListboxOptions element covers the ListboxButton element.