SearchType.Accordion UX improvement (#26935)
* Update default SearchType.Accordion behavior to NOT close accordion after selection. Signed-off-by: Sydney Achinger <sydneynicoleachinger@spotify.com>
This commit is contained in:
@@ -0,0 +1,5 @@
|
||||
---
|
||||
'@backstage/plugin-search': patch
|
||||
---
|
||||
|
||||
Updated the default SearchType.Accordion behavior to remain open after result type selection. This is a UX improvement to reduce the number of clicks needed when toggling result type filters.
|
||||
@@ -140,18 +140,6 @@ describe('SearchType.Accordion', () => {
|
||||
expect(setPageCursorMock).toHaveBeenCalledWith(undefined);
|
||||
});
|
||||
|
||||
it('should collapse when a new type is selected', async () => {
|
||||
const { getByText, queryByText } = render(
|
||||
<Wrapper>
|
||||
<SearchType.Accordion name={expectedLabel} types={[expectedType]} />
|
||||
</Wrapper>,
|
||||
);
|
||||
|
||||
await user.click(getByText(expectedType.name));
|
||||
|
||||
expect(queryByText('Collapse')).not.toBeInTheDocument();
|
||||
});
|
||||
|
||||
it('should show result counts if enabled', async () => {
|
||||
const { getAllByText } = render(
|
||||
<Wrapper>
|
||||
|
||||
@@ -96,7 +96,6 @@ export const SearchTypeAccordion = (props: SearchTypeAccordionProps) => {
|
||||
return () => {
|
||||
setTypes(type !== '' ? [type] : []);
|
||||
setPageCursor(undefined);
|
||||
setExpanded(false);
|
||||
};
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user