Prevent the FileValidator's remove button from bubbling up and closing modals when its within a modal.

This commit is contained in:
Yohn 2025-01-19 01:15:31 -05:00
parent db3dc3b43f
commit 30e7710688

View file

@ -94,7 +94,10 @@ class FileValidator {
const removeButton = document.createElement("button");
removeButton.textContent = " ";
removeButton.className = "btn-file-rm";
removeButton.addEventListener("click", () => this.removeFile(file, listItem));
removeButton.addEventListener("click", (event) => {
event.stopPropagation(); // Prevent event from bubbling up to modal
this.removeFile(file, listItem);
});
listItem.append(removeButton);