-
Notifications
You must be signed in to change notification settings - Fork 1.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix(accordion): add transition styles back #17418
fix(accordion): add transition styles back #17418
Conversation
✅ Deploy Preview for carbon-elements ready!
To edit notification comments on pull requests, go to your Netlify site configuration. |
✅ Deploy Preview for v11-carbon-react ready!
To edit notification comments on pull requests, go to your Netlify site configuration. |
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #17418 +/- ##
=======================================
Coverage 77.07% 77.07%
=======================================
Files 409 409
Lines 14021 14021
Branches 4355 4307 -48
=======================================
Hits 10807 10807
- Misses 3043 3044 +1
+ Partials 171 170 -1 ☔ View full report in Codecov by Sentry. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM!
4a7d935
Closes #17197
This fixes a regression that happened when #17120 was merged in to remove items from the dom when the accordion was closed. The issue with that was you can't animate/transition between display none and block. This PR uses @starting-style along with allow-discrete to be able to transition between display block. It currently has support in most major browsers, with partial support in Firefox (it will transition to display none but not from display none), this doesn't break anything and is an improvement from the current state of no transition at all.
Changelog
Testing / Reviewing
Check accordion story and make sure it transitions as expected in Chrome, check with keyboard and ensure that the buttons inside the test accordion item aren't accessible when the accordion is closed.