mirror of
https://github.com/carbon-design-system/carbon-components-svelte.git
synced 2025-09-15 18:31:06 +00:00
refactor(fileuploader): move reactive assignment
This commit is contained in:
parent
bb18cdf797
commit
d9c951f332
4 changed files with 9 additions and 17 deletions
|
@ -16,20 +16,12 @@
|
|||
import { cx } from '../../lib';
|
||||
|
||||
let inputRef = undefined;
|
||||
|
||||
$: _class = cx(
|
||||
'--btn',
|
||||
'--btn--sm',
|
||||
kind && `--btn--${kind}`,
|
||||
disabled && '--btn--disabled',
|
||||
className
|
||||
);
|
||||
</script>
|
||||
|
||||
<label
|
||||
tabindex={disabled ? '-1' : tabindex}
|
||||
aria-disabled={disabled}
|
||||
class={_class}
|
||||
class={cx('--btn', '--btn--sm', kind && `--btn--${kind}`, disabled && '--btn--disabled', className)}
|
||||
for={id}
|
||||
on:keydown
|
||||
on:keydown={({ key }) => {
|
||||
|
@ -54,8 +46,8 @@
|
|||
}
|
||||
}}
|
||||
on:click
|
||||
on:click={event => {
|
||||
event.target.value = null;
|
||||
on:click={({ target }) => {
|
||||
target.value = null;
|
||||
}}
|
||||
{id}
|
||||
{disabled}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue