From e2fcd757f783d11d34782e5eb66fa05e3df09cde Mon Sep 17 00:00:00 2001 From: Andrew Kingston Date: Fri, 6 Dec 2024 14:30:43 +0000 Subject: [PATCH] Stop coercing all values to strings when using CoreCheckboxGroup --- packages/bbui/src/Form/Core/CheckboxGroup.svelte | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/packages/bbui/src/Form/Core/CheckboxGroup.svelte b/packages/bbui/src/Form/Core/CheckboxGroup.svelte index d1a107fcc5..5aca7911e8 100644 --- a/packages/bbui/src/Form/Core/CheckboxGroup.svelte +++ b/packages/bbui/src/Form/Core/CheckboxGroup.svelte @@ -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( @@ -39,10 +38,9 @@ class="spectrum-Checkbox spectrum-Checkbox--sizeM spectrum-FieldGroup-item" > onChange(optionValue)} type="checkbox" class="spectrum-Checkbox-input" - value={optionValue} checked={value.includes(optionValue)} {disabled} />