Skip to content

Commit 04695b2

Browse files
committed
Add hidden attribute to internal <Hidden /> component when the Features.Hidden feature is used (#2955)
* add `hidden` attribute for `<Hidden features={Features.Hidden}>` * update changelog
1 parent 46a9b32 commit 04695b2

File tree

4 files changed

+4
-0
lines changed

4 files changed

+4
-0
lines changed

packages/@headlessui-react/CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
1717
- Make sure panels re-register when IDs are calculated in React < 18 ([#2883](https://github.com/tailwindlabs/headlessui/pull/2883))
1818
- Expose `disabled` state on `<Tab />` component ([#2918](https://github.com/tailwindlabs/headlessui/pull/2918))
1919
- Prevent default behaviour when clicking outside of a `Dialog.Panel` ([#2919](https://github.com/tailwindlabs/headlessui/pull/2919))
20+
- Add `hidden` attribute to internal `<Hidden />` component when the `Features.Hidden` feature is used ([#2955](https://github.com/tailwindlabs/headlessui/pull/2955))
2021

2122
## [1.7.18] - 2024-01-08
2223

packages/@headlessui-react/src/internal/hidden.tsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@ function VisuallyHidden<TTag extends ElementType = typeof DEFAULT_VISUALLY_HIDDE
2828
(features & Features.Focusable) === Features.Focusable
2929
? true
3030
: theirProps['aria-hidden'] ?? undefined,
31+
hidden: (features & Features.Hidden) === Features.Hidden ? true : undefined,
3132
style: {
3233
position: 'fixed',
3334
top: 1,

packages/@headlessui-vue/CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
1212
- Expose `disabled` state on `<Tab />` component ([#2918](https://github.com/tailwindlabs/headlessui/pull/2918))
1313
- Prevent default behaviour when clicking outside of a `DialogPanel` ([#2919](https://github.com/tailwindlabs/headlessui/pull/2919))
1414
- Don’t override explicit `disabled` prop for components inside `<MenuItem>` ([#2929](https://github.com/tailwindlabs/headlessui/pull/2929))
15+
- Add `hidden` attribute to internal `<Hidden />` component when the `Features.Hidden` feature is used ([#2955](https://github.com/tailwindlabs/headlessui/pull/2955))
1516

1617
## [1.7.19] - 2024-02-07
1718

packages/@headlessui-vue/src/internal/hidden.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@ export let Hidden = defineComponent({
2727
? true
2828
: // @ts-ignore
2929
theirProps['aria-hidden'] ?? undefined,
30+
hidden: (features & Features.Hidden) === Features.Hidden ? true : undefined,
3031
style: {
3132
position: 'fixed',
3233
top: 1,

0 commit comments

Comments
 (0)