Repository navigation
feat(disclosure): add data-entering and data-exiting attributes to DisclosurePanel - #11014
Open
2025sl93094 wants to merge 3 commits into
Open
2025sl93094 wants to merge 3 commits into
2025sl93094 wants to merge 3 commits into
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
DisclosurePanel permanently had overflow: clip, which clipped text descenders (g, y, p, j) and focus rings/shadows at the panel edges when the panel was fully open. The clip only needs to be active during the height transition, not when the panel is at rest.
This adds data-entering and data-exiting attributes to DisclosurePanel (and matching isEntering/isExiting render props), following the same pattern used by TabPanel, Popover, and Modal. The implementation uses the existing useEnterAnimation/useExitAnimation utilities directly in the component layer, keeping useDisclosure focused on accessibility semantics. A !isInitiallyExpanded guard (same as TabPanel) prevents a spurious data-entering on panels that are already open at mount.
Both CSS starters (starters/docs, starters/hooks) and the Tailwind starter are updated to scope overflow: clip to :is([data-entering, [data-exiting]) instead of applying it permanently.
Test Instructions :
Run the existing test suite:
yarn jest packages/react-aria-components/test/Disclosure.test.js
Two new tests added:
For manual verification: open the DisclosureWithAnimation story in Storybook (yarn start-parcel3), open the panel, and confirm text descenders and focus rings are not clipped when fully open.
Release impact
PR Checklist
My Project -> University open-source contribution assignment.