Skip to content

Commit

Permalink
fix: added role
Browse files Browse the repository at this point in the history
  • Loading branch information
vitalybaev committed Aug 30, 2021
1 parent 24e4f56 commit 29e3269
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions src/BaseSuggestions.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -297,8 +297,13 @@ export abstract class BaseSuggestions<SuggestionType, OwnProps> extends React.Pu

const Component = typeof customInput !== 'undefined' ? (customInput as ElementType) : 'input';

const optionsExpanded = isFocused && suggestions && displaySuggestions && suggestions.length > 0;
return (
<div className={containerClassName || 'react-dadata react-dadata__container'}>
<div
role="combobox"
aria-expanded={optionsExpanded}
className={containerClassName || 'react-dadata react-dadata__container'}
>
<div>
<Component
autoComplete="off"
Expand All @@ -315,7 +320,7 @@ export abstract class BaseSuggestions<SuggestionType, OwnProps> extends React.Pu
onBlur={this.handleInputBlur}
/>
</div>
{isFocused && suggestions && displaySuggestions && suggestions.length > 0 && (
{optionsExpanded && (
<div className={suggestionsClassName || 'react-dadata__suggestions'}>
{typeof hintText !== 'undefined' && (
<div className={hintClassName || 'react-dadata__suggestion-note'}>{hintText}</div>
Expand Down

0 comments on commit 29e3269

Please sign in to comment.