diff --git a/packages/@headlessui-react/CHANGELOG.md b/packages/@headlessui-react/CHANGELOG.md
index 52b3be2..81a94f3 100644
--- a/packages/@headlessui-react/CHANGELOG.md
+++ b/packages/@headlessui-react/CHANGELOG.md
@@ -19,6 +19,10 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
- Mark `SwitchGroup` as deprecated, prefer `Field` instead ([#3232](https://github.com/tailwindlabs/headlessui/pull/3232))
+### Changed
+
+- Use native `fieldset` instead of `div` by default for `
` component ([#3237](https://github.com/tailwindlabs/headlessui/pull/3237))
+
## [2.0.3] - 2024-05-07
### Fixed
diff --git a/packages/@headlessui-react/src/components/field/field.test.tsx b/packages/@headlessui-react/src/components/field/field.test.tsx
index d1c8b88..cd7bf63 100644
--- a/packages/@headlessui-react/src/components/field/field.test.tsx
+++ b/packages/@headlessui-react/src/components/field/field.test.tsx
@@ -55,7 +55,7 @@ describe('Rendering', () => {
let fieldset = container.firstChild
let field = fieldset?.firstChild
- expect(fieldset).toHaveAttribute('aria-disabled', 'true')
+ expect(fieldset).toHaveAttribute('disabled')
expect(field).toHaveAttribute('aria-disabled', 'true')
})
})
diff --git a/packages/@headlessui-react/src/components/fieldset/fieldset.test.tsx b/packages/@headlessui-react/src/components/fieldset/fieldset.test.tsx
index b7501fd..7fbd571 100644
--- a/packages/@headlessui-react/src/components/fieldset/fieldset.test.tsx
+++ b/packages/@headlessui-react/src/components/fieldset/fieldset.test.tsx
@@ -22,10 +22,24 @@ describe('Rendering', () => {
let fieldset = container.firstChild
+ expect(fieldset).toBeInstanceOf(HTMLFieldSetElement)
+ expect(fieldset).not.toHaveAttribute('role', 'group')
+ })
+
+ it('should render a `Fieldset` using a custom component', async () => {
+ let { container } = render(
+
+ )
+
+ let fieldset = container.firstChild
+
+ expect(fieldset).toBeInstanceOf(HTMLSpanElement)
expect(fieldset).toHaveAttribute('role', 'group')
})
- it('should add an `aria-disabled` attribute when disabling the `Fieldset`', async () => {
+ it('should forward the `disabled` attribute when disabling the `Fieldset`', async () => {
let { container } = render(