Skip to content

Commit

Permalink
Merge pull request #628 from tallstackui/feat/add-events-when-upload-…
Browse files Browse the repository at this point in the history
…multiples

[1.x] Fixing Upload Component: Dispatching Event When Upload Multiples
  • Loading branch information
devajmeireles authored Aug 22, 2024
2 parents 17895f6 + d7af5e6 commit 74bd258
Show file tree
Hide file tree
Showing 5 changed files with 143 additions and 141 deletions.
126 changes: 63 additions & 63 deletions composer.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion dist/.vite/manifest.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"js/tallstackui.js": {
"file": "tallstackui-CqOqKApt.js",
"file": "tallstackui-DL2AnEQz.js",
"name": "tallstackui",
"src": "js/tallstackui.js",
"isEntry": true,
Expand Down

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions js/components/form/upload.js
Original file line number Diff line number Diff line change
Expand Up @@ -38,11 +38,11 @@ export default (
this.uploading = true;
this.error = false;

this.$el.dispatchEvent(new CustomEvent('upload', {detail: {files: this.$refs.files.files}}));

if (this.multiple) return this.multiples();

this.single();

this.$el.dispatchEvent(new CustomEvent('upload', {detail: {files: this.$refs.files.files}}));
},
/**
* Upload multiple files.
Expand Down
Loading

0 comments on commit 74bd258

Please sign in to comment.