improve TechDocsSearch

Signed-off-by: Kiss Miklos <miklos@roadie.io>
This commit is contained in:
Kiss Miklos
2024-04-17 17:04:13 +02:00
parent d6165c19ae
commit 9b7dfe7ea9
@@ -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}