-
Notifications
You must be signed in to change notification settings - Fork 4.2k
Add aria-describedby attribute #4082
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Changes from all commits
5dec4fb
ac8ba65
6dc2fc7
cf96d2c
97d0d20
1f2614c
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
|
|
@@ -75,6 +75,8 @@ type FormatOptionLabelMeta = { | |||||
| }; | ||||||
|
|
||||||
| export type Props = { | ||||||
| /* HTML ID of an element that should be used to describe this input (for assistive tech) */ | ||||||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This and labelledby should actually not have language in the comments that suggests a single element, as both of those props accept a separated LIST of IDs.
Suggested change
|
||||||
| 'aria-describedby'?: string, | ||||||
| /* Aria label (for assistive tech) */ | ||||||
| 'aria-label'?: string, | ||||||
| /* HTML ID of an element that should be used as the label (for assistive tech) */ | ||||||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||
|
|
@@ -1422,6 +1424,7 @@ export default class Select extends Component<Props, State> { | |||||
| // aria attributes makes the JSX "noisy", separated for clarity | ||||||
| const ariaAttributes = { | ||||||
| 'aria-autocomplete': 'list', | ||||||
| 'aria-describedby': this.props['aria-describedby'], | ||||||
| 'aria-label': this.props['aria-label'], | ||||||
| 'aria-labelledby': this.props['aria-labelledby'], | ||||||
| }; | ||||||
|
|
||||||
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
An alternative suggestion: