Skip to content

Commit

Permalink
Removed unnecessary modal hide listener (#136)
Browse files Browse the repository at this point in the history
  • Loading branch information
MHamzaBham authored Jan 2, 2025
1 parent 6136f97 commit 12891ed
Showing 1 changed file with 0 additions and 8 deletions.
8 changes: 0 additions & 8 deletions public/assets/js/custom.js
Original file line number Diff line number Diff line change
Expand Up @@ -199,14 +199,6 @@ function openModalForAdd() {
const modalElement = document.getElementById("transactionModal");
const modal = new bootstrap.Modal(modalElement);

// Ensure backdrop is removed and modal disposed on close
modalElement.addEventListener('hidden.bs.modal', function () {
document.body.classList.remove('modal-open'); // Remove modal-open class from body
const backdrop = document.querySelector('.modal-backdrop');
if (backdrop) backdrop.remove(); // Remove leftover backdrop
modal.dispose(); // Properly dispose of the modal instance
});

modal.show();
}

Expand Down

0 comments on commit 12891ed

Please sign in to comment.