Skip to content

Commit

Permalink
docs(input) more descriptive fixed text documentation
Browse files Browse the repository at this point in the history
  • Loading branch information
SiTaggart committed Jan 23, 2018
1 parent 15af4d6 commit 5ca99aa
Showing 1 changed file with 13 additions and 4 deletions.
17 changes: 13 additions & 4 deletions ui/components/input/_doc.scss
Original file line number Diff line number Diff line change
Expand Up @@ -20,10 +20,6 @@
* If the error message has an `id="my-error-message"`, then the input should
* have `aria-describedby="my-error-message"`.
*
* ##### Fixed Text
*
* When using the fixed text variants for prepending or appending symbols to inputs, please be sure to use `aria-labelledby` on the input, that points to the ids of the label, prepended text and appended text as a space separated list. The IDs must appear in that order, label, prepended, then appended.
*
* If you need some type of field level help and if your tooltips are
* available on hover, make sure they’re also available on keyboard focus. The
* help icon needs to be associated to the tooltip so that when the user focuses
Expand All @@ -33,6 +29,19 @@
*
* In some cases, the read-only field state is swapped and has no `<input>`. This is called `static` in the examples. In that case, don’t use a `<label>`. This provides better accessibility for screen readers and keyboard navigators. Instead, use a `<span>` with the `.slds-form-element__label` class. Instead of an `<input>`, use the `.slds-form-element__static` class inside the `.slds-form-element__control` wrapper.
*
* ##### Fixed Text
*
* When using the fixed text variants for prepending or appending symbols to inputs,
* please be sure to use `aria-labelledby` on the input, that points to the ids of the label,
* prepended text and appended text as a space separated list. The IDs must appear in that order:
* label, prepended, then appended.
*
* The reason we do this is to create a better association between the input and the supporting labels around it.
* By only using the traditional `label[for]` method, the fixed text is never read out in the context of editing
* the input value. With using the `aria-labelledby` attribute we can create a better label with all the
* visual labels associated with it, in a relevant order, that is read by assistive technology when the user
* needs it; when they're editing the value.
*
* @summary Text inputs are used for freeform data entry
*
* @base
Expand Down

0 comments on commit 5ca99aa

Please sign in to comment.