@@ -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}
|
||||
|
||||
Reference in New Issue
Block a user