Skip to content

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

Merged
RobinMalfait merged 2 commits intomainfrom
fix/issue-2947
Jan 31, 2024
Merged

Add hidden attribute to internal <Hidden /> component when the Features.Hidden feature is used#2955
RobinMalfait merged 2 commits intomainfrom
fix/issue-2947

Conversation

@RobinMalfait
Copy link
Copy Markdown
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

@vercel
Copy link
Copy Markdown

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
@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