From 9b7dfe7ea98bc6bd30daaa511b96e47b08c36db0 Mon Sep 17 00:00:00 2001 From: Kiss Miklos Date: Wed, 17 Apr 2024 17:04:13 +0200 Subject: [PATCH 1/2] improve TechDocsSearch Signed-off-by: Kiss Miklos --- plugins/techdocs/src/search/components/TechDocsSearch.tsx | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/plugins/techdocs/src/search/components/TechDocsSearch.tsx b/plugins/techdocs/src/search/components/TechDocsSearch.tsx index 665f99c1bb..ce77d547db 100644 --- a/plugins/techdocs/src/search/components/TechDocsSearch.tsx +++ b/plugins/techdocs/src/search/components/TechDocsSearch.tsx @@ -63,6 +63,7 @@ const TechDocsSearchBar = (props: TechDocsSearchProps) => { const navigate = useNavigate(); const { setFilters, + term, result: { loading, value: searchVal }, } = useSearch(); const [options, setOptions] = useState([]); @@ -109,7 +110,7 @@ const TechDocsSearchBar = (props: TechDocsSearchProps) => { ''} 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} From 1256d8813d3fc5ad0eca36d78b66825ca6c48b1e Mon Sep 17 00:00:00 2001 From: Kiss Miklos Date: Wed, 17 Apr 2024 18:37:35 +0200 Subject: [PATCH 2/2] add changeset Signed-off-by: Kiss Miklos --- .changeset/slimy-fans-raise.md | 5 +++++ 1 file changed, 5 insertions(+) create mode 100644 .changeset/slimy-fans-raise.md diff --git a/.changeset/slimy-fans-raise.md b/.changeset/slimy-fans-raise.md new file mode 100644 index 0000000000..782ef4bc82 --- /dev/null +++ b/.changeset/slimy-fans-raise.md @@ -0,0 +1,5 @@ +--- +'@backstage/plugin-techdocs': patch +--- + +Fix weird opening behaviour of the component.