Skip to content

Commit

Permalink
Don't set display: none on elements that use hidden="until-found" (
Browse files Browse the repository at this point in the history
…#14631)

Fixes an issue reported by the React Aria Components team here:

adobe/react-spectrum#7160

Basically `hidden="until-found"` behaves very differently than `hidden`
and doesn't actually use `display: none`, so we don't want to apply the
behavior we apply for the regular `hidden` attribute.
  • Loading branch information
RobinMalfait authored Oct 9, 2024
1 parent 1467dab commit b1733ac
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 2 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
- Ensure there's always a space before `!important` when stringifying CSS ([#14611](https://github.com/tailwindlabs/tailwindcss/pull/14611))
- _Upgrade (experimental)_: Ensure CSS before a layer stays unlayered when running codemods ([#14596](https://github.com/tailwindlabs/tailwindcss/pull/14596))
- _Upgrade (experimental)_: Resolve issues where some prefixed candidates were not properly migrated ([#14600](https://github.com/tailwindlabs/tailwindcss/pull/14600))
- Don't set `display: none` on elements that use `hidden="until-found"` ([#14631](https://github.com/tailwindlabs/tailwindcss/pull/14631))

## [4.0.0-alpha.26] - 2024-10-03

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -576,7 +576,7 @@ exports[`\`@import 'tailwindcss'\` is replaced with the generated CSS 1`] = `
height: auto;
}
[hidden] {
[hidden]:where(:not([hidden="until-found"])) {
display: none !important;
}
}
Expand Down
2 changes: 1 addition & 1 deletion packages/tailwindcss/preflight.css
Original file line number Diff line number Diff line change
Expand Up @@ -321,6 +321,6 @@ video {
Make elements with the HTML hidden attribute stay hidden by default.
*/

[hidden] {
[hidden]:where(:not([hidden='until-found'])) {
display: none !important;
}

0 comments on commit b1733ac

Please sign in to comment.