Skip to content

Commit

Permalink
Fixing a11y errors in querybar and suggestion_component (#26892) (#26974
Browse files Browse the repository at this point in the history
)

* correcting a11y errors so that we can add a11y rules to tslint

* updating the jest snapshot

* updating the jest snapshot
  • Loading branch information
bhavyarm authored Dec 11, 2018
1 parent 71a2478 commit ce4ce99
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ exports[`QueryBar Should disable autoFocus on EuiFieldText when disableAutoFocus
onOutsideClick={[Function]}
>
<div
aria-controls="typeahead-items"
aria-expanded={false}
aria-haspopup="true"
aria-owns="typeahead-items"
Expand Down Expand Up @@ -126,6 +127,7 @@ exports[`QueryBar Should pass the query language to the language switcher 1`] =
onOutsideClick={[Function]}
>
<div
aria-controls="typeahead-items"
aria-expanded={false}
aria-haspopup="true"
aria-owns="typeahead-items"
Expand Down Expand Up @@ -234,6 +236,7 @@ exports[`QueryBar Should render the given query 1`] = `
onOutsideClick={[Function]}
>
<div
aria-controls="typeahead-items"
aria-expanded={false}
aria-haspopup="true"
aria-owns="typeahead-items"
Expand Down
1 change: 1 addition & 0 deletions src/ui/public/query_bar/components/query_bar.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -472,6 +472,7 @@ export class QueryBarUI extends Component<Props, State> {
aria-haspopup="true"
aria-expanded={this.state.isSuggestionsVisible}
aria-owns="typeahead-items"
aria-controls="typeahead-items"
>
<form role="form" name="queryBarForm">
<div className="kuiLocalSearch" role="search">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

exports[`SuggestionComponent Should display the suggestion and use the provided ariaId 1`] = `
<div
aria-selected={false}
className="typeahead-item"
id="suggestion-1"
onClick={[Function]}
Expand Down Expand Up @@ -38,6 +39,7 @@ exports[`SuggestionComponent Should display the suggestion and use the provided

exports[`SuggestionComponent Should make the element active if the selected prop is true 1`] = `
<div
aria-selected={true}
className="typeahead-item active"
id="suggestion-1"
onClick={[Function]}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,7 @@ export const SuggestionComponent: SFC<Props> = props => {
onMouseEnter={props.onMouseEnter}
ref={props.innerRef}
id={props.ariaId}
aria-selected={props.selected}
>
<div className={'suggestionItem suggestionItem--' + props.suggestion.type}>
<div className="suggestionItem__type">
Expand Down

0 comments on commit ce4ce99

Please sign in to comment.