mirror of
https://github.com/picocss/pico.git
synced 2025-04-24 10:26:13 -04:00
Prevent the FileValidator's remove button from bubbling up and closing modals when its within a modal.
This commit is contained in:
parent
db3dc3b43f
commit
30e7710688
1 changed files with 4 additions and 1 deletions
|
@ -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);
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue