diff --git a/static/js/preview_list_modal.js b/static/js/preview_list_modal.js index 7f904fa..31dabfd 100644 --- a/static/js/preview_list_modal.js +++ b/static/js/preview_list_modal.js @@ -2,6 +2,12 @@ document.addEventListener("DOMContentLoaded", function () { const modalElement = document.getElementById("productPreviewModal"); const modal = new bootstrap.Modal(modalElement); + modalElement.addEventListener('hidden.bs.modal', function () { + document.querySelectorAll('.modal-backdrop').forEach(el => el.remove()); + document.body.classList.remove('modal-open'); + document.body.style.overflow = ''; + }); + document.querySelectorAll(".preview-btn").forEach((btn) => { btn.addEventListener("click", async () => { const listId = btn.dataset.listId; @@ -71,4 +77,4 @@ document.addEventListener("DOMContentLoaded", function () { } }); }); -}); +}); \ No newline at end of file