Skip to content
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

Merged

Conversation

alisonjoseph
Copy link
Member

@alisonjoseph alisonjoseph commented Sep 11, 2024

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

  • Remove hidden from AccordionItem
  • Remove old/unused mixins from accordion scss
  • Add @starting-style and allow-discrete styles for transition animation
  • Update test to check for active classname, remove style import from test(this was the only test file we were doing this)

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.

Copy link

netlify bot commented Sep 11, 2024

Deploy Preview for carbon-elements ready!

Name Link
🔨 Latest commit 1adaee8
🔍 Latest deploy log https://app.netlify.com/sites/carbon-elements/deploys/6703f4377d57320008914c80
😎 Deploy Preview https://deploy-preview-17418--carbon-elements.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

Copy link

netlify bot commented Sep 11, 2024

Deploy Preview for v11-carbon-react ready!

Name Link
🔨 Latest commit 1adaee8
🔍 Latest deploy log https://app.netlify.com/sites/v11-carbon-react/deploys/6703f437ec44c700076b3cad
😎 Deploy Preview https://deploy-preview-17418--v11-carbon-react.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

@alisonjoseph alisonjoseph marked this pull request as ready for review September 11, 2024 20:21
@alisonjoseph alisonjoseph requested a review from a team as a code owner September 11, 2024 20:21
@alisonjoseph alisonjoseph marked this pull request as draft September 11, 2024 20:21
@alisonjoseph alisonjoseph marked this pull request as ready for review October 7, 2024 14:47
Copy link

codecov bot commented Oct 7, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 77.07%. Comparing base (e8c7672) to head (1adaee8).
Report is 44 commits behind head on main.

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.
📢 Have feedback on the report? Share it here.

Copy link
Member

@ariellalgilmore ariellalgilmore left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

@kennylam kennylam added this pull request to the merge queue Oct 14, 2024
Merged via the queue into carbon-design-system:main with commit 4a7d935 Oct 14, 2024
36 checks passed
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.

[Bug]: Accordion items do not animate
3 participants