mirror of
https://github.com/carbon-design-system/carbon-components-svelte.git
synced 2025-09-20 20:33:02 +00:00
feat(file-uploader-drop-container): dispatch instead of forward change event
This commit is contained in:
parent
8bfdb7f4e1
commit
e1cfc5864f
1 changed files with 4 additions and 2 deletions
|
@ -1,6 +1,7 @@
|
|||
<script>
|
||||
/**
|
||||
* @event {File} add
|
||||
* @event {File[]} add
|
||||
* @event {File[]} change
|
||||
*/
|
||||
|
||||
/**
|
||||
|
@ -76,6 +77,7 @@
|
|||
over = false;
|
||||
files = validateFiles([...dataTransfer.files]);
|
||||
dispatch('add', files);
|
||||
dispatch('change', files);
|
||||
}
|
||||
}}"
|
||||
>
|
||||
|
@ -111,10 +113,10 @@
|
|||
name="{name}"
|
||||
multiple="{multiple}"
|
||||
class:bx--file-input="{true}"
|
||||
on:change
|
||||
on:change="{({ target }) => {
|
||||
files = validateFiles([...target.files]);
|
||||
dispatch('add', files);
|
||||
dispatch('change', files);
|
||||
}}"
|
||||
on:click
|
||||
on:click="{({ target }) => {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue