Skip to content
This repository has been archived by the owner on Jun 20, 2022. It is now read-only.

Commit

Permalink
fix(a11y): remove aria-describedby (redundant with aria-labelledby)
Browse files Browse the repository at this point in the history
  • Loading branch information
gregberge committed Aug 30, 2019
1 parent b24487a commit 03d4d94
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 3 deletions.
1 change: 0 additions & 1 deletion packages/shared/core/Form.js
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,6 @@ export function createFieldsGroupContext(type) {
return {
...props,
id,
'aria-describedby': props['aria-describedby'] || labelId,
'aria-labelledby': props['aria-labelledby'] || labelId,
}
}
Expand Down
4 changes: 2 additions & 2 deletions website/src/pages/docs/form.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ import { Props } from '../../components/Props'

## Basic

`Form`, `FormField`, `FormFieldLabel`, `FormCheck`, `FormCheckLabel` are the foundations of form layout. Components are smart and automatically link labels to form controls if a name is provided. A unique `id` is automatically generated, `htmlFor` is added to `label` and `aria-labelledby` / `aria-describedby` attributes are added to controls.
`Form`, `FormField`, `FormFieldLabel`, `FormCheck`, `FormCheckLabel` are the foundations of form layout. Components are smart and automatically link labels to form controls if a name is provided. A unique `id` is automatically generated, `htmlFor` is added to `label` and `aria-labelledby` attributes are added to controls.

```jsx live noInline
import React from 'react'
Expand Down Expand Up @@ -372,7 +372,7 @@ render(<Example />)
All forms components follow [WAI-ARIA Pattern](https://www.w3.org/TR/wai-aria-1.1/) to ensure a complete accesibility of your forms.

- Role `form` is automatically added to `form` if not a native `form` element
- `aria-describedby` and `aria-labelledby` are automatically added to `label` when a name is provided
- `aria-labelledby` is automatically added to `label` when a name is provided

## API

Expand Down

0 comments on commit 03d4d94

Please sign in to comment.