Emit change event after modifying interal state

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:
Alexis Reigel 2022-01-17 11:12:35 +01:00
commit fd6700d5b3
No known key found for this signature in database
GPG key ID: C728AF10972E97C0

View file

@ -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}">