Skip to content

Commit

Permalink
Stop coercing all values to strings when using CoreCheckboxGroup
Browse files Browse the repository at this point in the history
  • Loading branch information
aptkingston committed Dec 6, 2024
1 parent 9231b58 commit e2fcd75
Showing 1 changed file with 3 additions and 5 deletions.
8 changes: 3 additions & 5 deletions packages/bbui/src/Form/Core/CheckboxGroup.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,8 @@
const dispatch = createEventDispatcher()
const onChange = e => {
const optionValue = e.target.value
if (e.target.checked && !value.includes(optionValue)) {
const onChange = optionValue => {
if (!value.includes(optionValue)) {
dispatch("change", [...value, optionValue])
} else {
dispatch(
Expand All @@ -39,10 +38,9 @@
class="spectrum-Checkbox spectrum-Checkbox--sizeM spectrum-FieldGroup-item"
>
<input
on:change={onChange}
on:change={() => onChange(optionValue)}
type="checkbox"
class="spectrum-Checkbox-input"
value={optionValue}
checked={value.includes(optionValue)}
{disabled}
/>
Expand Down

0 comments on commit e2fcd75

Please sign in to comment.