fix(accordion): L3-0000 align expand/collapse animation with Radix pattern#877
Conversation
…ttern Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
✅ Deploy Preview for phillips-seldon ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
|
Tip All tests passed and all changes approved!🟢 UI Tests: 458 tests unchanged |
|
🚀 Storybook preview is ready. • Preview: https://68b9f094608b90f3cfec5a06-mrcuxjhnju.chromatic.com/ |
There was a problem hiding this comment.
Pull request overview
Updates the Accordion component’s SCSS to align expand/collapse animation behavior with Radix’s recommended “animate height only” pattern, addressing spacing and animation glitches during open/close.
Changes:
- Moves bottom spacing to an inner
.radix-accordion-contentwrapper (instead of padding/margins on the animated element). - Ensures the content element participates in height animation by forcing
display: block. - Simplifies the keyframes to animate
heightonly and tweaks easing / fill-mode to better match Radix behavior.
## [1.265.1](v1.265.0...v1.265.1) (2026-06-12) ### Bug Fixes * **accordion:** L3-0000 align expand/collapse animation with Radix pattern ([#877](#877)) ([84bad14](84bad14))
|
🎉 This PR is included in version 1.265.1 🎉 The release is available on: Your semantic-release bot 📦🚀 |
Jira ticket
L3-13058
Screenshots
Screen.Recording.2026-06-12.at.12.13.13.PM.mov
Video of before/after animation to be added.
Summary
The accordion expand/collapse animation didn't follow the Radix accordion animation pattern, which caused two visible glitches:
padding-bottomlived on the animatedAccordion.Contentelement itself, so the keyframedheightcould never reach a true0. Radix docs require padding to live on a child ofContent.Accordion.Contentrenders (viaasChild+Text) as an inline<span>, which ignoresheightanimation and vertical padding.Change List
[data-state='open']padding / Content's deadmargin-bottom(vertical margins don't apply to inline elements) topadding-bottomon the inner.radix-accordion-contentwrapperdisplay: blockto__contentso the<span>rendered byTexthonors height animation and paddingheightonly (removedopacityand a brokenpadding: 0), matching the Radix referenceease-in-out→ease-out, matching the Radix referenceanimation-fill-mode: forwardstoslide-uponly, so the closed content holds at height 0 until Radix unmounts it (no end-frame flash); open content is not pinned so it can reflow after opening--transition[data-state]rule blocksAcceptance Test (how to verify the PR)
Components/Accordion→DefaulthasTransition: true) — content should slide down smoothly from the very start (no initial pop)$spacing-sm)Regression Test
hasTransition(e.g. viaAccordionSubmenustory) still open/close instantly with identical spacingEvidence of testing
vitest run src/components/Accordion/)Things to look for during review
feat(scope): ...if aminorrelease should be triggered.phillipsclass prefix are using the prefix variabledata-testidattribute.