Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[6.x] Fixing a11y errors in querybar and suggestion_component (#26892) #26974

Merged
merged 1 commit into from
Dec 11, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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