Skip to content

Commit

Permalink
Add change event handler to file upload input
Browse files Browse the repository at this point in the history
  • Loading branch information
aarongarciah committed Apr 11, 2024
1 parent 71a880d commit 745281a
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 6 deletions.
8 changes: 6 additions & 2 deletions docs/data/material/components/buttons/InputFileUpload.js
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,12 @@ export default function InputFileUpload() {
tabIndex={-1}
startIcon={<CloudUploadIcon />}
>
Upload file
<VisuallyHiddenInput type="file" />
Upload files
<VisuallyHiddenInput
type="file"
onChange={(event) => console.log(event.target.files)}
multiple
/>
</Button>
);
}
8 changes: 6 additions & 2 deletions docs/data/material/components/buttons/InputFileUpload.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,12 @@ export default function InputFileUpload() {
tabIndex={-1}
startIcon={<CloudUploadIcon />}
>
Upload file
<VisuallyHiddenInput type="file" />
Upload files
<VisuallyHiddenInput
type="file"
onChange={(event) => console.log(event.target.files)}
multiple
/>
</Button>
);
}
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,10 @@
tabIndex={-1}
startIcon={<CloudUploadIcon />}
>
Upload file
<VisuallyHiddenInput type="file" />
Upload files
<VisuallyHiddenInput
type="file"
onChange={(event) => console.log(event.target.files)}
multiple
/>
</Button>

0 comments on commit 745281a

Please sign in to comment.