-
Notifications
You must be signed in to change notification settings - Fork 3
Description
What component (if applicable)
- URL for category: https://catalyst.tailwindui.com/docs/dropdown
- Component name: Dropdown
Describe the bug
If you place a Dropdown inside Field, the label in dropdown items is not clickable. I'm using the Catalyst library, but I'm pretty sure the problem is actually inside Headless.
For more context, in my project I have "extended" inputs, which have prefixes and postfixes and looks like following:
I need to make the dropdown placed in the "postfix" area to work. However, I've figured out that you may place the dropdown anywhere within the Field component and the bug is reproducible.
To Reproduce
Steps to reproduce the behavior:
- Create a React project with Tailwind and Catalyst
- Create a component containing the following:
import './App.css'
import { Field, FieldGroup, Fieldset } from './lib/catalyst/fieldset'
import { Dropdown, DropdownButton, DropdownItem, DropdownLabel, DropdownMenu } from './lib/catalyst/dropdown'
function App() {
return (
<>
<Fieldset>
<FieldGroup>
<Field>
<Dropdown>
<DropdownButton>Dropdown</DropdownButton>
<DropdownMenu>
<DropdownItem onClick={() => alert(1)}>
<DropdownLabel>Label</DropdownLabel>
</DropdownItem>
</DropdownMenu>
</Dropdown>
</Field>
</FieldGroup>
</Fieldset>
</>
)
}
export default App
Expected behavior
When you click on the label part of dropdown item, it should react (in the above case, show an alert). It does not. It works though if you click the non-label part of the dropdown item (e.g. right to the text)
Screenshots
Browser/Device (if applicable)
- OS: Windows 11
- Browser Chrome
- Version 136.0.7103.93
Additional context
It may have to do with the fact that the label has an attribute data-slot="label". I guess the Headless' Field component introduces some behavior or CSS for such children, which prevents the dropdown's label to be clickable.

