Skip to content

Commit

Permalink
fix(styles): added overflow visible for open post-collapsible
Browse files Browse the repository at this point in the history
  • Loading branch information
alionazherdetska committed Dec 18, 2024
1 parent 99bbea1 commit b540d1c
Showing 1 changed file with 8 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -66,20 +66,22 @@ export class PostCollapsible {
@Method()
async toggle(open = !this.isOpen): Promise<boolean> {
if (open === this.isOpen) return open;

this.isOpen = open;
this.collapsed = !open;
if (this.isLoaded) this.postToggle.emit(open);

const animation = open ? expand(this.host) : collapse(this.host);

if (!this.isLoaded || isMotionReduced()) animation.finish();

await animation.finished;

const isHostRendered = this.host.offsetParent;
if (isHostRendered) animation.commitStyles();

if (open) {
this.host.style.overflow = 'visible';
}

return open;
}

Expand All @@ -100,5 +102,5 @@ export class PostCollapsible {
<slot />
</Host>
);
}
}
}

0 comments on commit b540d1c

Please sign in to comment.