Skip to content

Commit

Permalink
fix: modal-closed event being fired more than once
Browse files Browse the repository at this point in the history
  • Loading branch information
wout-o committed Sep 5, 2024
1 parent 78e2542 commit a1f0875
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions resources/views/components/modal/index.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -67,11 +67,13 @@
livewire: null,
close: function () {
this.isOpen = false
if (this.isOpen) {
this.isOpen = false
this.$refs.modalContainer.dispatchEvent(
new CustomEvent('modal-closed', { id: '{{ $id }}' }),
)
this.$refs.modalContainer.dispatchEvent(
new CustomEvent('modal-closed', { id: '{{ $id }}' }),
)
}
},
open: function () {
Expand Down

0 comments on commit a1f0875

Please sign in to comment.