Skip to content

Commit

Permalink
Reset ConfirmationButton onDisconnected
Browse files Browse the repository at this point in the history
  • Loading branch information
marein committed Nov 4, 2024
1 parent 91cfd5f commit 035a464
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions assets/js/Common/ConfirmationButton.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,10 @@ customElements.define('confirmation-button', class extends HTMLElement {
this._button?.addEventListener('click', this._onButtonClick.bind(this));
}

disconnectedCallback() {
this.reset();
}

reset() {
document.removeEventListener('click', this._onDocumentClick);
this.replaceChildren(...this._initialChildren);
Expand Down

0 comments on commit 035a464

Please sign in to comment.