Skip to content
This repository was archived by the owner on Feb 6, 2023. It is now read-only.

Commit a6af3e1

Browse files
Suraj Karnatifacebook-github-bot
authored andcommitted
Adding aria-describedby attribute the draft editor
Summary: We have a ariaDescribedBy prop in DraftEditorProps.js but it is not set in DraftEditor. Currently the aria-describedby attribute is set based on if there is a placeholder and is set to the placeholderId. https://developer.mozilla.org/en-US/docs/Web/Accessibility/ARIA/ARIA_Techniques/Using_the_aria-describedby_attribute issue on github which also has suggested the fix: #1214 Reviewed By: jessebeach, flarnie Differential Revision: D6154932 fbshipit-source-id: d828ca5f73921c5d303820c5aed5b39eda08ccd1
1 parent 3689a93 commit a6af3e1

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/component/base/DraftEditor.react.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -264,7 +264,7 @@ class DraftEditor extends React.Component<DraftEditorProps, State> {
264264
aria-autocomplete={readOnly ? null : this.props.ariaAutoComplete}
265265
aria-controls={readOnly ? null : this.props.ariaControls}
266266
aria-describedby={
267-
this._showPlaceholder() ? this._placeholderAccessibilityID : null
267+
this.props.ariaDescribedBy || this._placeholderAccessibilityID
268268
}
269269
aria-expanded={readOnly ? null : ariaExpanded}
270270
aria-label={this.props.ariaLabel}

0 commit comments

Comments
 (0)