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

Add hidden attribute to internal <Hidden /> component when the Features.Hidden feature is used #2955

Merged
merged 2 commits into from
Jan 31, 2024

Conversation

RobinMalfait
Copy link
Member

@RobinMalfait RobinMalfait commented Jan 31, 2024

This PR adds the hidden attribute to the <Hidden /> component if the Features.Hidden is used as a feature.

We used to only add display: none, but that's not enough since certain CSS selectors still "see" this DOM node.

E.g.: space-x-4 in Tailwind CSS will set the margin-left on everything but the first DOM node. It is implemented with an exception for the hidden attribute.

Fixes: #2947

Copy link

vercel bot commented Jan 31, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
headlessui-react ✅ Ready (Inspect) Visit Preview 💬 Add feedback Jan 31, 2024 0:20am
headlessui-vue ✅ Ready (Inspect) Visit Preview 💬 Add feedback Jan 31, 2024 0:20am

@RobinMalfait RobinMalfait merged commit edbcb81 into main Jan 31, 2024
8 checks passed
@RobinMalfait RobinMalfait deleted the fix/issue-2947 branch January 31, 2024 12:29
RobinMalfait added a commit that referenced this pull request Apr 15, 2024
…eatures.Hidden` feature is used (#2955)

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

* update changelog
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Dialog] Visually hidden element without hidden attribute
1 participant