Skip to content

Commit

Permalink
Add hidden attribute to internal <Hidden /> component when the `F…
Browse files Browse the repository at this point in the history
…eatures.Hidden` feature is used (#2955)

* add `hidden` attribute for `<Hidden features={Features.Hidden}>`

* update changelog
  • Loading branch information
RobinMalfait committed Apr 15, 2024
1 parent 46a9b32 commit 04695b2
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 0 deletions.
1 change: 1 addition & 0 deletions packages/@headlessui-react/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
- Make sure panels re-register when IDs are calculated in React < 18 ([#2883](https://github.com/tailwindlabs/headlessui/pull/2883))
- Expose `disabled` state on `<Tab />` component ([#2918](https://github.com/tailwindlabs/headlessui/pull/2918))
- Prevent default behaviour when clicking outside of a `Dialog.Panel` ([#2919](https://github.com/tailwindlabs/headlessui/pull/2919))
- Add `hidden` attribute to internal `<Hidden />` component when the `Features.Hidden` feature is used ([#2955](https://github.com/tailwindlabs/headlessui/pull/2955))

## [1.7.18] - 2024-01-08

Expand Down
1 change: 1 addition & 0 deletions packages/@headlessui-react/src/internal/hidden.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ function VisuallyHidden<TTag extends ElementType = typeof DEFAULT_VISUALLY_HIDDE
(features & Features.Focusable) === Features.Focusable
? true
: theirProps['aria-hidden'] ?? undefined,
hidden: (features & Features.Hidden) === Features.Hidden ? true : undefined,
style: {
position: 'fixed',
top: 1,
Expand Down
1 change: 1 addition & 0 deletions packages/@headlessui-vue/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
- Expose `disabled` state on `<Tab />` component ([#2918](https://github.com/tailwindlabs/headlessui/pull/2918))
- Prevent default behaviour when clicking outside of a `DialogPanel` ([#2919](https://github.com/tailwindlabs/headlessui/pull/2919))
- Don’t override explicit `disabled` prop for components inside `<MenuItem>` ([#2929](https://github.com/tailwindlabs/headlessui/pull/2929))
- Add `hidden` attribute to internal `<Hidden />` component when the `Features.Hidden` feature is used ([#2955](https://github.com/tailwindlabs/headlessui/pull/2955))

## [1.7.19] - 2024-02-07

Expand Down
1 change: 1 addition & 0 deletions packages/@headlessui-vue/src/internal/hidden.ts
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ export let Hidden = defineComponent({
? true
: // @ts-ignore
theirProps['aria-hidden'] ?? undefined,
hidden: (features & Features.Hidden) === Features.Hidden ? true : undefined,
style: {
position: 'fixed',
top: 1,
Expand Down

0 comments on commit 04695b2

Please sign in to comment.