diff --git a/.changeset/tricky-buckets-sniff.md b/.changeset/tricky-buckets-sniff.md new file mode 100644 index 0000000000..1b592677b9 --- /dev/null +++ b/.changeset/tricky-buckets-sniff.md @@ -0,0 +1,5 @@ +--- +'@swisspost/design-system-components': patch +--- + +Resolved an issue where `post-accordion` components placed within inactive tab panels caused animation-related exceptions. \ No newline at end of file diff --git a/packages/components/src/components/post-collapsible/post-collapsible.tsx b/packages/components/src/components/post-collapsible/post-collapsible.tsx index 85b8a04165..cc8bb94515 100644 --- a/packages/components/src/components/post-collapsible/post-collapsible.tsx +++ b/packages/components/src/components/post-collapsible/post-collapsible.tsx @@ -77,7 +77,10 @@ export class PostCollapsible { await animation.finished; - animation.commitStyles(); + const isVisible = this.host.offsetParent || this.host.offsetWidth || this.host.offsetHeight; + if (isVisible) { + animation.commitStyles(); + } return open; }