From b570e2b887b6709164ffccc02a9af3a2eb32318d Mon Sep 17 00:00:00 2001 From: Adam Wathan Date: Wed, 9 Oct 2024 07:55:48 -0400 Subject: [PATCH] Don't set `display: none` on elements that use `hidden="until-found"` (#14625) Fixes an issue reported by the React Aria Components team here: https://github.com/adobe/react-spectrum/issues/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. --------- Co-authored-by: Robin Malfait --- CHANGELOG.md | 4 +++- src/css/preflight.css | 2 +- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 25edaad623a8..c08b3a14a745 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,7 +7,9 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ## [Unreleased] -- Nothing yet! +### Fixed + +- Don't set `display: none` on elements that use `hidden="until-found"` ([#14625](https://github.com/tailwindlabs/tailwindcss/pull/14625)) ## [3.4.13] - 2024-09-23 diff --git a/src/css/preflight.css b/src/css/preflight.css index 7a0d82d46e04..04b9d1424a32 100644 --- a/src/css/preflight.css +++ b/src/css/preflight.css @@ -381,6 +381,6 @@ video { } /* Make elements with the HTML hidden attribute stay hidden by default */ -[hidden] { +[hidden]:where(:not([hidden="until-found"])) { display: none; }