Skip to content

Commit

Permalink
fix(Dialog): Remove after dialog was hidden
Browse files Browse the repository at this point in the history
Wait for the animation to end before removing
the sl-dialog from the DOM.
  • Loading branch information
tvdeyen committed May 7, 2024
1 parent 9a600f2 commit 0c5c326
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions app/javascript/alchemy_admin/dialog.js
Original file line number Diff line number Diff line change
Expand Up @@ -107,8 +107,10 @@ export class Dialog {
* remove the dialog from dom
*/
#removeDialog() {
this.#dialogComponent.remove()
this.#isOpen = false
this.#dialogComponent.addEventListener("sl-after-hide", () => {
this.#dialogComponent.remove()
this.#isOpen = false
})
}

/**
Expand Down

0 comments on commit 0c5c326

Please sign in to comment.