feat(file-uploader-drop-container): dispatch instead of forward change event

This commit is contained in:
Eric Liu 2022-02-21 10:24:27 -08:00
commit e1cfc5864f

View file

@ -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 }) => {