Skip to content

feat(disclosure): add data-entering and data-exiting attributes to DisclosurePanel - #11014

Open
2025sl93094 wants to merge 3 commits into
adobe:mainfrom
2025sl93094:feat/disclosure-panel-transition-attrs
Open

2025sl93094 wants to merge 3 commits into
adobe:mainfrom
2025sl93094:feat/disclosure-panel-transition-attrs

Conversation

@2025sl93094

@2025sl93094 2025sl93094 commented Nov 22, 2026 •

Copy link
Copy Markdown

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:

  • Asserts no data-entering/data-exiting on initial render (both collapsed and expanded cases)
  • Asserts isEntering/isExiting render props flow correctly into className

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

  • Adds a feature or API while keeping existing usage working.

PR Checklist

  • I followed the contributing guide.
  • I tested this change locally and included the results in Test Instructions, or explained why testing does not apply.
  • I understand and can explain every change in this PR. I used AI assistance (Claude) and followed the AI contribution guidance.

My Project -> University open-source contribution assignment.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant