Skip to content

Commit

Permalink
fix(esl-animate): fix handling of esl-animate-mixin attribute changes
Browse files Browse the repository at this point in the history
  • Loading branch information
abarmina committed Apr 29, 2024
1 parent 5887a04 commit 0bb3a44
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions src/modules/esl-animate/core/esl-animate-mixin.ts
Original file line number Diff line number Diff line change
Expand Up @@ -31,17 +31,21 @@ export class ESLAnimateMixin extends ESLMixinElement {
}

@ready
public override connectedCallback(): void {
protected override connectedCallback(): void {
super.connectedCallback();
this.reanimate();
}

@ready
public override disconnectedCallback(): void {
protected override disconnectedCallback(): void {
super.disconnectedCallback();
ESLAnimateService.unobserve(this.$host);
}

protected override attributeChangedCallback(name: string, oldValue: string | null, newValue: string | null): void {
this.reanimate();
}

/** Reinitialize {@link ESLAnimateService} for target */
public reanimate(): void {
ESLAnimateService.unobserve(this.$host);
Expand Down

0 comments on commit 0bb3a44

Please sign in to comment.