Skip to content

Commit

Permalink
feat(ProjectListItemCollapsible): fix toggle blinking
Browse files Browse the repository at this point in the history
  • Loading branch information
asabotovich committed Jun 21, 2023
1 parent f29104d commit e2f9386
Showing 1 changed file with 3 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -37,8 +37,9 @@ export const ProjectListItemCollapsable: React.FC<ProjectListItemCollapsableProp
}) => {
const [collapsed, setIsCollapsed] = useState(true);
const [collapsedGoals, setIsCollapsedGoals] = useState(true);
const contentHidden = collapsed || loading;

const offset = collapseOffset * (collapsed ? deep - 1 : deep);
const offset = collapseOffset * (contentHidden ? deep - 1 : deep);
const childs = useMemo(() => project.children.map(({ id }) => id), [project]);

const onClickEnabled = childs.length;
Expand All @@ -65,7 +66,7 @@ export const ProjectListItemCollapsable: React.FC<ProjectListItemCollapsableProp

return (
<Collapsable
collapsed={collapsed || loading}
collapsed={contentHidden}
onClick={onClick}
header={
<ProjectListContainer offset={offset}>
Expand Down

0 comments on commit e2f9386

Please sign in to comment.