Skip to content

fix(component): fix animation error in post-collapsible rendered inside inactive tabs #5502

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

Open
wants to merge 3 commits into
base: release/v8
Choose a base branch
from

Conversation

alionazherdetska
Copy link
Contributor

📄 Description

This PR adds visibility check before committing animation styles in PostCollapsible.toggle() to prevent InvalidStateError when the target element is hidden. This resolves errors occurring when animating elements inside hidden tab panels.


📝 Checklist

  • ✅ My code follows the style guidelines of this project
  • 🛠️ I have performed a self-review of my own code
  • 📄 I have made corresponding changes to the documentation
  • ⚠️ My changes generate no new warnings or errors
  • 🧪 I have added tests that prove my fix is effective or that my feature works
  • ✔️ New and existing unit tests pass locally with my changes

@alionazherdetska alionazherdetska requested a review from a team as a code owner May 15, 2025 07:40
Copy link

changeset-bot bot commented May 15, 2025

🦋 Changeset detected

Latest commit: 6016a48

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 17 packages
Name Type
@swisspost/design-system-components Patch
@swisspost/design-system-components-angular-workspace Patch
@swisspost/design-system-components-react Patch
@swisspost/design-system-documentation Patch
@swisspost/design-system-components-angular Patch
@swisspost/design-system-nextjs-integration Patch
@swisspost/design-system-styles Patch
@swisspost/design-system-tokens Patch
@swisspost/design-system-intranet-header Patch
@swisspost/design-system-icons Patch
@swisspost/design-system-migrations Patch
@swisspost/design-system-styles-primeng Patch
@swisspost/design-system-demo Patch
@swisspost/internet-header Patch
@swisspost/design-system-intranet-header-workspace Patch
@swisspost/design-system-styles-primeng-workspace Patch
@swisspost/design-system-intranet-header-showcase Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@swisspost-bot
Copy link
Contributor

swisspost-bot commented May 15, 2025

Related Previews

@alionazherdetska alionazherdetska changed the title fix(component): fix animation error in post-collapsible when inside inactive tabs fix(component): fix animation error in post-collapsible rendered inside inactive tabs May 15, 2025
Copy link
Contributor

@alizedebray alizedebray left a comment

Choose a reason for hiding this comment

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

The expand and collapse animations are set with the fill: 'forwards' option, which ensures that the final keyframe of the animation remains applied to the element once the animation completes. However, using fill modes to persist an animation's effect is generally not recommended for several reasons (see the Web Animation API documentation).

Therefore, whenever the expand orcollapse animation are triggered, the styles must be explicitly committed using animation.commitStyles();.

Currently, if the element is not visible, the collapse animation will still run, but the animation effects are not properly committed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[bug]: Accordion in inactive tab throws error
3 participants