Skip to content

Commit

Permalink
Fix: Expand/Collapse toggling (#1750)
Browse files Browse the repository at this point in the history
  • Loading branch information
ElinorW authored May 25, 2022
1 parent e14ba4f commit 9a2f1a7
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 9 deletions.
2 changes: 1 addition & 1 deletion src/app/utils/generate-groups.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { IGroup } from '@fluentui/react';

export function generateGroupsFromList(list: any[], property: string) {
export function generateGroupsFromList(list: any[], property: string) : IGroup[]{
const map = new Map();
const groups: IGroup[] = [];

Expand Down
11 changes: 3 additions & 8 deletions src/app/views/sidebar/sample-queries/SampleQueries.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -276,13 +276,9 @@ const unstyledSampleQueries = (sampleProps?: ISampleQueriesProps): JSX.Element =
};

const renderGroupHeader = (props: any): any => {
const onToggleSelectGroup = () => {
props.onToggleCollapse(props.group);
};

return (
<GroupHeader
compact={true}
{...props}
styles={{
check: { display: 'none' },
title: {
Expand All @@ -293,8 +289,6 @@ const unstyledSampleQueries = (sampleProps?: ISampleQueriesProps): JSX.Element =
fontSize: FontSizes.small
}
}}
{...props}
onToggleSelectGroup={onToggleSelectGroup}
/>
);
};
Expand All @@ -305,8 +299,9 @@ const unstyledSampleQueries = (sampleProps?: ISampleQueriesProps): JSX.Element =

if (selectedQuery) {
const index = groups.findIndex(k => k.key === selectedQuery.category);
if (index !== -1) {
if (index > 0 ) {
groups[index].isCollapsed = false;
groups[0].isCollapsed = true;
}
}

Expand Down

0 comments on commit 9a2f1a7

Please sign in to comment.