diff --git a/src/components/checkbox-group/checkbox/bl-checkbox.stories.mdx b/src/components/checkbox-group/checkbox/bl-checkbox.stories.mdx index 7a718f0c..27e38613 100644 --- a/src/components/checkbox-group/checkbox/bl-checkbox.stories.mdx +++ b/src/components/checkbox-group/checkbox/bl-checkbox.stories.mdx @@ -20,9 +20,6 @@ import { Meta, Canvas, ArgsTable, Story } from '@storybook/addon-docs'; indeterminate: { control: 'boolean', default: false - }, - value: { - control: 'text', }, required: { control: 'boolean', @@ -34,7 +31,6 @@ export const CheckboxTemplate = (args) => html`${args.label}`; @@ -135,10 +131,10 @@ Disabled state can be set via `disabled` attribute. A checkbox can be `disabled` Checkbox component has 'required' validation rule. Also custom invalid text can be passed by 'invalid-text' attribute - + {CheckboxTemplate.bind({})} - + {CheckboxTemplate.bind({})} @@ -148,7 +144,7 @@ Checkbox component has 'required' validation rule. Also custom invalid text can Provide the name and the value of the checkbox element, so that its value can be set on the form element - + {FormTemplate.bind({})} diff --git a/src/components/checkbox-group/checkbox/bl-checkbox.ts b/src/components/checkbox-group/checkbox/bl-checkbox.ts index 88748279..be401c3c 100644 --- a/src/components/checkbox-group/checkbox/bl-checkbox.ts +++ b/src/components/checkbox-group/checkbox/bl-checkbox.ts @@ -112,17 +112,10 @@ export default class BlCheckbox extends FormControlMixin(LitElement) { this.form?.removeEventListener("submit", e => this.handleSubmit(e)); } - protected firstUpdated(changedProperties: Map) { - if (changedProperties.has("checked") && this.checked) { - this.value = "on"; - this.setValue(this.value); - } - } - protected async updated(changedProperties: Map): Promise { if (changedProperties.has("checked") && this.required) { if (this.checked) { - this.setValue(this.value); + this.setValue("on"); } else if (!this.checked) { this.setValue(""); }