diff --git a/packages/@headlessui-react/CHANGELOG.md b/packages/@headlessui-react/CHANGELOG.md index 86e612f..c53d878 100644 --- a/packages/@headlessui-react/CHANGELOG.md +++ b/packages/@headlessui-react/CHANGELOG.md @@ -11,6 +11,10 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 - Add a quick trigger action to the `Menu`, `Listbox` and `Combobox` components ([#3700](https://github.com/tailwindlabs/headlessui/pull/3700)) +### Fixed + +- Fix clicking `Label` component should open `` ([#3707](https://github.com/tailwindlabs/headlessui/pull/3707)) + ## [2.2.2] - 2025-04-17 ### Fixed diff --git a/packages/@headlessui-react/src/components/label/label.tsx b/packages/@headlessui-react/src/components/label/label.tsx index edde216..fa294bb 100644 --- a/packages/@headlessui-react/src/components/label/label.tsx +++ b/packages/@headlessui-react/src/components/label/label.tsx @@ -166,7 +166,7 @@ function LabelFn( // unchecked). if ( (target instanceof HTMLInputElement && - (target.type === 'radio' || target.type === 'checkbox')) || + (target.type === 'file' || target.type === 'radio' || target.type === 'checkbox')) || target.role === 'radio' || target.role === 'checkbox' || target.role === 'switch' diff --git a/playgrounds/react/pages/combinations/form.tsx b/playgrounds/react/pages/combinations/form.tsx index 8d951e4..0ba071a 100644 --- a/playgrounds/react/pages/combinations/form.tsx +++ b/playgrounds/react/pages/combinations/form.tsx @@ -1,4 +1,4 @@ -import { Combobox, Listbox, RadioGroup, Switch } from '@headlessui/react' +import { Combobox, Field, Input, Label, Listbox, RadioGroup, Switch } from '@headlessui/react' import { useState } from 'react' import { Button } from '../../components/button' import { classNames } from '../../utils/class-names' @@ -332,6 +332,24 @@ export default function App() { +
+ + + + + + + + + + + + + + + + +