mirror of
https://github.com/carbon-design-system/carbon-components-svelte.git
synced 2025-09-15 02:11:05 +00:00
Emit Checkbox
change event after modifying internal state (#1013)
The checkbox's internal state doesn't match the visual checked / unchecked state. The behaviour is visible when using 1-way binding on the checkbox and using the on:change event. The internal state is always the opposite of the visual state.
This commit is contained in:
parent
58de79d66b
commit
9b32fe90f5
1 changed files with 1 additions and 1 deletions
|
@ -89,13 +89,13 @@
|
||||||
name="{name}"
|
name="{name}"
|
||||||
readonly="{readonly}"
|
readonly="{readonly}"
|
||||||
class:bx--checkbox="{true}"
|
class:bx--checkbox="{true}"
|
||||||
on:change
|
|
||||||
on:change="{() => {
|
on:change="{() => {
|
||||||
checked = !checked;
|
checked = !checked;
|
||||||
group = group.includes(value)
|
group = group.includes(value)
|
||||||
? group.filter((_value) => _value !== value)
|
? group.filter((_value) => _value !== value)
|
||||||
: [...group, value];
|
: [...group, value];
|
||||||
}}"
|
}}"
|
||||||
|
on:change
|
||||||
on:blur
|
on:blur
|
||||||
/>
|
/>
|
||||||
<label for="{id}" title="{title}" class:bx--checkbox-label="{true}">
|
<label for="{id}" title="{title}" class:bx--checkbox-label="{true}">
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue