From 7f0cab28386ec4bde8ec6289377bff9e53cd019b Mon Sep 17 00:00:00 2001 From: Jesse Beach Date: Tue, 1 Aug 2017 11:18:04 -0700 Subject: [PATCH] Change aria-owns to aria-controls in draft.js Summary: 'aria-owns' creates a parent-child relationship between the owner and ownee in the AX Tree. We really don't want the typeahead dialog to be a child of the input. `aria-controls` sets up a controller-controllee relationship. This is the correct relationship for the input and its typeahead dialog. **This is a breaking API change.** Reviewed By: flarnie Differential Revision: D5476399 fbshipit-source-id: fe69255351dcd173e08de1aa21d8ee0a6728b68d --- src/component/base/DraftEditor.react.js | 2 +- src/component/base/DraftEditorProps.js | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/component/base/DraftEditor.react.js b/src/component/base/DraftEditor.react.js index c665754a38..7d91b0e590 100644 --- a/src/component/base/DraftEditor.react.js +++ b/src/component/base/DraftEditor.react.js @@ -249,6 +249,7 @@ class DraftEditor extends React.Component { readOnly ? null : this.props.ariaActiveDescendantID } aria-autocomplete={readOnly ? null : this.props.ariaAutoComplete} + aria-controls={readOnly ? null : this.props.ariaControls} aria-describedby={ this._showPlaceholder() ? this._placeholderAccessibilityID : null } @@ -256,7 +257,6 @@ class DraftEditor extends React.Component { aria-haspopup={readOnly ? null : ariaHasPopup} aria-label={this.props.ariaLabel} aria-multiline={this.props.ariaMultiline} - aria-owns={readOnly ? null : this.props.ariaOwneeID} autoCapitalize={this.props.autoCapitalize} autoComplete={this.props.autoComplete} autoCorrect={this.props.autoCorrect} diff --git a/src/component/base/DraftEditorProps.js b/src/component/base/DraftEditorProps.js index 8fa057944a..7ba5564329 100644 --- a/src/component/base/DraftEditorProps.js +++ b/src/component/base/DraftEditorProps.js @@ -92,12 +92,12 @@ export type DraftEditorProps = { ariaActiveDescendantID?: string, ariaAutoComplete?: string, + ariaControls?: string, ariaDescribedBy?: string, ariaExpanded?: boolean, ariaHasPopup?: boolean, ariaLabel?: string, ariaMultiline?: boolean, - ariaOwneeID?: string, webDriverTestID?: string,