Skip to content

Commit

Permalink
fix: recover the original opacity of the element on VFX.remove() (#76)
Browse files Browse the repository at this point in the history
  • Loading branch information
fand authored Jul 4, 2024
1 parent 7e92e1a commit e11a330
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion packages/vfx-js/src/vfx-player.ts
Original file line number Diff line number Diff line change
Expand Up @@ -285,7 +285,10 @@ export class VFXPlayer {
removeElement(element: HTMLElement): void {
const i = this.#elements.findIndex((e) => e.element === element);
if (i !== -1) {
this.#elements.splice(i, 1);
const e = this.#elements.splice(i, 1)[0] as VFXElement;

// Recover the original state
element.style.setProperty("opacity", e.originalOpacity.toString());
}
}

Expand Down

0 comments on commit e11a330

Please sign in to comment.