Skip to content

Commit

Permalink
Fix aria owns value (#1556)
Browse files Browse the repository at this point in the history
  • Loading branch information
mhubenthal authored and agirton committed May 17, 2017
1 parent fd19b91 commit 196c7bb
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion src/Select.js
Original file line number Diff line number Diff line change
Expand Up @@ -868,12 +868,17 @@ const Select = createClass({

if (this.props.disabled || !this.props.searchable) {
const { inputClassName, ...divProps } = this.props.inputProps;

const ariaOwns = classNames({
[this._instancePrefix + '-list']: isOpen,
});

return (
<div
{...divProps}
role="combobox"
aria-expanded={isOpen}
aria-owns={isOpen ? this._instancePrefix + '-list' : this._instancePrefix + '-value'}
aria-owns={ariaOwns}
aria-activedescendant={isOpen ? this._instancePrefix + '-option-' + focusedOptionIndex : this._instancePrefix + '-value'}
className={className}
tabIndex={this.props.tabIndex || 0}
Expand Down

0 comments on commit 196c7bb

Please sign in to comment.