Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Dialog] Visually hidden element without hidden attribute #2947

Closed
nicoqh opened this issue Jan 27, 2024 · 1 comment · Fixed by #2955
Closed

[Dialog] Visually hidden element without hidden attribute #2947

nicoqh opened this issue Jan 27, 2024 · 1 comment · Fixed by #2955
Assignees

Comments

@nicoqh
Copy link

nicoqh commented Jan 27, 2024

What package within Headless UI are you using?

@headlessui/react

What version of that package are you using?

v1.7.18

Reproduction URL

https://codesandbox.io/p/devbox/empty-browser-glzqwd

Describe your issue

<div class="space-y-6">
    <Dialog ... />
    <Item />
    <Item />
    <Item />
</div>

Tailwind's spacing utilities don't affect hidden elements (.space-y-6 > :not([hidden]) ~ :not([hidden])). But there's an element that renders in place of <Dialog> which is visually hidden, but without a hidden attribute. The result is that a top margin is added to the first <Item>.

A solution could be to add the hidden attribute, or use aria-hidden which is even less tied to Tailwind.

@RobinMalfait
Copy link
Member

This should be fixed by #2955, and will be available in the next release.

You can already try it using:

  • npm install @headlessui/react@insiders.
  • npm install @headlessui/vue@insiders.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
2 participants