fix(Collapsible): CSS-driven accordion height animation (#1917) - #1992
fix(Collapsible): CSS-driven accordion height animation (#1917)#1992kotAPI wants to merge 1 commit into
Conversation
When transitionDuration is 0, skip inline height in the open steady state and expose measured size via CSS variables so consumers can animate with keyframes. Add --rad-accordion-content-* aliases on Accordion content.
|
CoverageThis report compares the PR with the base branch. "Δ" shows how the PR affects each metric.
Coverage improved or stayed the same. Great job! Run |
📝 WalkthroughWalkthrough
ChangesCollapsible zero-duration height fix and accordion CSS var rename
Estimated code review effort🎯 2 (Simple) | ⏱️ ~10 minutes Possibly related issues
Possibly related PRs
Suggested labels
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Comment |
Code reviewLGTM. Matches project patterns for portal Theme refs, Floating UI prop merge, controlled-switch/lazy-mount/RTL tests, or focused bug fixes. No changes requested. |
Summary
transitionDuration={0}, Collapsible content no longer sets inlineheightin the steady open state so consumers can animate expand/collapse via CSS keyframes ondata-state.--radix-collapsible-content-height/--radix-collapsible-content-width, with a re-render bump sodefaultOpenexposes correct values.Accordion.Contentforwards--rad-accordion-content-heightand--rad-accordion-content-widthaliases for Radix-style migration.Related to #1917 (CSS animation parity); does not address the
type="single"value shape gap.Test plan
npm test -- src/core/primitives/Collapsible/tests/Collapsible.test.tsxtransitionDuration={0}and CSS keyframes usingvar(--rad-accordion-content-height)Summary by CodeRabbit