design-system icon indicating copy to clipboard operation
design-system copied to clipboard

FormField has limitation to render children

Open BeniCheni opened this issue 5 years ago • 1 comments

FormField has strict requirement of children, which creates limitation to render children w. composition such as the snippet below for a11y.

It'd be nice to improve the support of support to offer a more robust composition w. possibilities.

<FormField>
  <SrOnly>
    <Label>Voice Over</Label>
  </SrOnly>
  <Icon>
  <Select>
    <option>a</option>
  </Select>
<FormField>
Screen Shot 2019-07-18 at 6 46 45 PM

BeniCheni avatar Jul 19 '19 13:07 BeniCheni

Discussion notes

Before starting work, we should define a list of allowed child components and a cap on the number of children. We could cap it at 5 children if SrOnly is used, and 4 otherwise.

Proposed allowed children:

  • Label
  • SrOnly
  • Icon
  • Input
  • Select
  • Autocomplete

craigpalermo avatar Apr 03 '20 18:04 craigpalermo