fix(file-uploader): move input outside of label to fix a11y error

Ref: https://github.com/carbon-design-system/carbon/pull/10444
This commit is contained in:
Eric Liu 2022-02-10 06:30:15 -08:00
commit f627e1b6f3

View file

@ -93,24 +93,24 @@
{labelText}
</slot>
</div>
<input
bind:this="{ref}"
type="file"
tabindex="-1"
id="{id}"
disabled="{disabled}"
accept="{accept}"
name="{name}"
multiple="{multiple}"
class:bx--file-input="{true}"
on:change
on:change="{({ target }) => {
dispatch('add', validateFiles(target.files));
}}"
on:click
on:click="{({ target }) => {
target.value = null;
}}"
/>
</label>
<input
bind:this="{ref}"
type="file"
tabindex="-1"
id="{id}"
disabled="{disabled}"
accept="{accept}"
name="{name}"
multiple="{multiple}"
class:bx--file-input="{true}"
on:change
on:change="{({ target }) => {
dispatch('add', validateFiles(target.files));
}}"
on:click
on:click="{({ target }) => {
target.value = null;
}}"
/>
</div>