Skip to content

Commit 30e7710

Browse files
committed
Prevent the FileValidator's remove button from bubbling up and closing modals when its within a modal.
1 parent db3dc3b commit 30e7710

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

docs/js/FileValidator.js

+4-1
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,10 @@ class FileValidator {
9494
const removeButton = document.createElement("button");
9595
removeButton.textContent = " ";
9696
removeButton.className = "btn-file-rm";
97-
removeButton.addEventListener("click", () => this.removeFile(file, listItem));
97+
removeButton.addEventListener("click", (event) => {
98+
event.stopPropagation(); // Prevent event from bubbling up to modal
99+
this.removeFile(file, listItem);
100+
});
98101

99102
listItem.append(removeButton);
100103

0 commit comments

Comments
 (0)