Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Stop coercing all values to strings when using CoreCheckboxGroup #15136

Merged
merged 4 commits into from
Dec 10, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading