From 9fc4185f876dd6ffd8414868ac95ceeed3be41b0 Mon Sep 17 00:00:00 2001 From: Patrick McElhaney Date: Wed, 31 Aug 2022 17:14:34 -0400 Subject: [PATCH] Better descriptions for checkbox attributes (#894) The description for the checkbox's value attribute is currently "the checkbox's value attribute." I think we can do better than that, especially considering anyone who hasn't worked with old-school HTML forms that POST to the URL in the `action` attribute is unlikely to know why a checkbox has a value and that value is not boolean. While I was here I improved a couple of other descriptions. If there's an interest, I can expand this PR to update all of the properties in all controls where the description is tautological. --- src/components/checkbox/checkbox.ts | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/components/checkbox/checkbox.ts b/src/components/checkbox/checkbox.ts index bc30a3c5..2effae66 100644 --- a/src/components/checkbox/checkbox.ts +++ b/src/components/checkbox/checkbox.ts @@ -42,13 +42,13 @@ export default class SlCheckbox extends ShoelaceElement { @state() private hasFocus = false; - /** The checkbox's name attribute. */ + /** Name of the HTML form control. Submitted with the form as part of a name/value pair. */ @property() name: string; - /** The checkbox's value attribute. */ + /** Value of the HTML form control. Primarily used to differentiate a list of related checkboxes that have the same name. */ @property() value: string; - /** Disables the checkbox. */ + /** Disables the checkbox (so the user can't check / uncheck it). */ @property({ type: Boolean, reflect: true }) disabled = false; /** Makes the checkbox a required field. */ @@ -57,7 +57,7 @@ export default class SlCheckbox extends ShoelaceElement { /** Draws the checkbox in a checked state. */ @property({ type: Boolean, reflect: true }) checked = false; - /** Draws the checkbox in an indeterminate state. */ + /** Draws the checkbox in an indeterminate state. Usually applies to a checkbox that represents "select all" or "select none" when the items to which it applies are a mix of selected and unselected. */ @property({ type: Boolean, reflect: true }) indeterminate = false; /** This will be true when the control is in an invalid state. Validity is determined by the `required` prop. */