mirror of
https://github.com/carbon-design-system/carbon-components-svelte.git
synced 2025-09-14 18:01:06 +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}"
|
||||
readonly="{readonly}"
|
||||
class:bx--checkbox="{true}"
|
||||
on:change
|
||||
on:change="{() => {
|
||||
checked = !checked;
|
||||
group = group.includes(value)
|
||||
? group.filter((_value) => _value !== value)
|
||||
: [...group, value];
|
||||
}}"
|
||||
on:change
|
||||
on:blur
|
||||
/>
|
||||
<label for="{id}" title="{title}" class:bx--checkbox-label="{true}">
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue