mirror of
https://github.com/carbon-design-system/carbon-components-svelte.git
synced 2025-09-20 12:23:02 +00:00
breaking(file-uploader-drop-container): change file type from FileList to File[]
This commit is contained in:
parent
826b7096c8
commit
45c0e7960b
1 changed files with 4 additions and 4 deletions
|
@ -1,6 +1,6 @@
|
|||
<script>
|
||||
/**
|
||||
* @event {FileList} add
|
||||
* @event {File} add
|
||||
*/
|
||||
|
||||
/**
|
||||
|
@ -15,7 +15,7 @@
|
|||
/**
|
||||
* Override the default behavior of validating uploaded files
|
||||
* The default behavior does not validate files
|
||||
* @type {(files: FileList) => FileList}
|
||||
* @type {(files: File) => File}
|
||||
*/
|
||||
export let validateFiles = (files) => files;
|
||||
|
||||
|
@ -68,7 +68,7 @@
|
|||
on:drop|preventDefault|stopPropagation="{({ dataTransfer }) => {
|
||||
if (!disabled) {
|
||||
over = false;
|
||||
dispatch('add', validateFiles(dataTransfer.files));
|
||||
dispatch('add', validateFiles([...dataTransfer.files]));
|
||||
}
|
||||
}}"
|
||||
>
|
||||
|
@ -106,7 +106,7 @@
|
|||
class:bx--file-input="{true}"
|
||||
on:change
|
||||
on:change="{({ target }) => {
|
||||
dispatch('add', validateFiles(target.files));
|
||||
dispatch('add', validateFiles([...target.files]));
|
||||
}}"
|
||||
on:click
|
||||
on:click="{({ target }) => {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue