Ensure checkbox always has a size class
This commit is contained in:
parent
50247bd066
commit
0c5a34dacb
|
@ -8,16 +8,18 @@
|
||||||
export let id = null
|
export let id = null
|
||||||
export let text = null
|
export let text = null
|
||||||
export let disabled = false
|
export let disabled = false
|
||||||
export let size = null
|
export let size
|
||||||
|
|
||||||
const dispatch = createEventDispatcher()
|
const dispatch = createEventDispatcher()
|
||||||
const onChange = event => {
|
const onChange = event => {
|
||||||
dispatch("change", event.target.checked)
|
dispatch("change", event.target.checked)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
$: sizeClass = `spectrum-Checkbox--size${size || "M"}`
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<label
|
<label
|
||||||
class="spectrum-Checkbox spectrum-Checkbox--size{size} spectrum-Checkbox--emphasized"
|
class="spectrum-Checkbox spectrum-Checkbox--emphasized {sizeClass}"
|
||||||
class:is-invalid={!!error}
|
class:is-invalid={!!error}
|
||||||
>
|
>
|
||||||
<input
|
<input
|
||||||
|
|
Loading…
Reference in New Issue