Skip to content

Commit

Permalink
ariaActivedescendant = false not valid aria
Browse files Browse the repository at this point in the history
  • Loading branch information
Jordan-Hall authored Apr 21, 2022
1 parent d892838 commit b9eb9c3
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/autocomplete.js
Original file line number Diff line number Diff line change
Expand Up @@ -457,6 +457,10 @@ export default class Autocomplete extends Component {
'aria-describedby': assistiveHintID
} : null

const ariaActivedescendantProp = (optionFocused) ? {
'aria-activedescendant': `${id}__option--${focused}`
} : null

let dropdownArrow

// we only need a dropdown arrow if showAllValues is set to a truthy value
Expand Down Expand Up @@ -492,7 +496,7 @@ export default class Autocomplete extends Component {

<input
aria-expanded={menuOpen ? 'true' : 'false'}
aria-activedescendant={optionFocused ? `${id}__option--${focused}` : false}
{...ariaActivedescendantProp}
aria-owns={`${id}__listbox`}
aria-autocomplete={(this.hasAutoselect()) ? 'both' : 'list'}
{...ariaDescribedProp}
Expand Down

0 comments on commit b9eb9c3

Please sign in to comment.