Skip to content

Commit

Permalink
Merge pull request #15136 from Budibase/fix-multi-checkbox-value-coer…
Browse files Browse the repository at this point in the history
…cion

Stop coercing all values to strings when using CoreCheckboxGroup
  • Loading branch information
aptkingston authored Dec 10, 2024
2 parents a5f5f39 + 5a093da commit a3c1bbc
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 a3c1bbc

Please sign in to comment.