Skip to content
This repository was archived by the owner on Jul 19, 2019. It is now read-only.

Commit 45a70b1

Browse files
committed
Add missing aria-expanded attribute (fixes #215)
1 parent c93f128 commit 45a70b1

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

lib/Autocomplete.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -431,12 +431,14 @@ let Autocomplete = React.createClass({
431431
}
432432

433433
const { inputProps } = this.props
434+
const open = ('open' in this.props ? this.props.open : this.state.isOpen)
434435
return (
435436
<div style={{...this.props.wrapperStyle}} {...this.props.wrapperProps}>
436437
<input
437438
{...inputProps}
438439
role="combobox"
439440
aria-autocomplete="list"
441+
aria-expanded={open}
440442
autoComplete="off"
441443
ref="input"
442444
onFocus={this.composeEventHandlers(this.handleInputFocus, inputProps.onFocus)}
@@ -447,7 +449,7 @@ let Autocomplete = React.createClass({
447449
onClick={this.composeEventHandlers(this.handleInputClick, inputProps.onClick)}
448450
value={this.props.value}
449451
/>
450-
{('open' in this.props ? this.props.open : this.state.isOpen) && this.renderMenu()}
452+
{open && this.renderMenu()}
451453
{this.props.debug && (
452454
<pre style={{marginLeft: 300}}>
453455
{JSON.stringify(_debugStates.slice(_debugStates.length - 5, _debugStates.length), null, 2)}

0 commit comments

Comments
 (0)