Skip to content
This repository has been archived by the owner on Jan 4, 2022. It is now read-only.

Commit

Permalink
set aria-autocomplete to 'none' on the input element in react-select
Browse files Browse the repository at this point in the history
  • Loading branch information
bergieboy committed Sep 23, 2020
1 parent de70488 commit 5eb7251
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion src/containers/location/providers/LocationSearchBar.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

import React, {
useCallback,
useRef,
useState
} from 'react';

Expand Down Expand Up @@ -70,6 +71,14 @@ const SearchIcon = <FontAwesomeIcon icon={faSearch} fixedWidth />;

const LocationsSearchBar = () => {

const refInput = useRef(null);
if (refInput.current) {
const inputElement :HTMLInputElement = refInput.current.querySelector('input');
if (inputElement && inputElement.ariaAutoComplete === 'list') {
inputElement.setAttribute('aria-autocomplete', 'none');
}
}

const renderText = useSelector(getRenderTextFn);
const currentLocationText = renderText(LABELS.CURRENT_LOCATION);
const optionsFetchState = useSelector((store) => store.getIn([STATE.LOCATIONS, 'options', 'fetchState']));
Expand Down Expand Up @@ -129,7 +138,7 @@ const LocationsSearchBar = () => {
}

return (
<Wrapper>
<Wrapper ref={refInput}>
<Select
aria-label="address"
components={{ GroupHeading }}
Expand Down

0 comments on commit 5eb7251

Please sign in to comment.