Skip to content

Commit edbcb81

Browse files
authored
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 ce17c6d commit edbcb81

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
@@ -13,6 +13,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
1313
- Prevent default behaviour when clicking outside of a `Dialog.Panel` ([#2919](https://github.com/tailwindlabs/headlessui/pull/2919))
1414
- Use `isFocused` instead of `isFocusVisible` for `Input` and `Textarea` components ([#2940](https://github.com/tailwindlabs/headlessui/pull/2940))
1515
- Ensure `children` prop of `Field` component can be a render prop ([#2941](https://github.com/tailwindlabs/headlessui/pull/2941))
16+
- Add `hidden` attribute to internal `<Hidden />` component when the `Features.Hidden` feature is used ([#2955](https://github.com/tailwindlabs/headlessui/pull/2955))
1617

1718
## [2.0.0-alpha.4] - 2024-01-03
1819

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,7 @@ function VisuallyHidden<TTag extends ElementType = typeof DEFAULT_VISUALLY_HIDDE
3535
(features & HiddenFeatures.Focusable) === HiddenFeatures.Focusable
3636
? true
3737
: theirProps['aria-hidden'] ?? undefined,
38+
hidden: (features & HiddenFeatures.Hidden) === HiddenFeatures.Hidden ? true : undefined,
3839
style: {
3940
position: 'fixed',
4041
top: 1,

packages/@headlessui-vue/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
- Expose `disabled` state on `<Tab />` component ([#2918](https://github.com/tailwindlabs/headlessui/pull/2918))
1818
- Prevent default behaviour when clicking outside of a `DialogPanel` ([#2919](https://github.com/tailwindlabs/headlessui/pull/2919))
1919
- Don’t override explicit `disabled` prop for components inside `<MenuItem>` ([#2929](https://github.com/tailwindlabs/headlessui/pull/2929))
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.17] - 2024-01-08
2223

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)