Merge pull request #24334 from RoadieHQ/improve-techdocs-search-bar

Improve techdocs search bar
This commit is contained in:
Sydney Achinger
2024-05-14 11:51:24 -04:00
committed by GitHub
2 changed files with 8 additions and 2 deletions
@@ -63,6 +63,7 @@ const TechDocsSearchBar = (props: TechDocsSearchProps) => {
const navigate = useNavigate();
const {
setFilters,
term,
result: { loading, value: searchVal },
} = useSearch();
const [options, setOptions] = useState<any[]>([]);
@@ -109,7 +110,7 @@ const TechDocsSearchBar = (props: TechDocsSearchProps) => {
<SearchAutocomplete
data-testid="techdocs-search-bar"
size="small"
open={open}
open={open && Boolean(term)}
getOptionLabel={() => ''}
filterOptions={x => {
return x; // This is needed to get renderOption to be called after options change. Bug in material-ui?
@@ -117,7 +118,7 @@ const TechDocsSearchBar = (props: TechDocsSearchProps) => {
onClose={() => {
setOpen(false);
}}
onFocus={() => {
onOpen={() => {
setOpen(true);
}}
onChange={handleSelection}