Skip to content

Commit

Permalink
fix: all nodes highlighted treeview (#920)
Browse files Browse the repository at this point in the history
  • Loading branch information
Gustav-Eikaas authored Feb 18, 2025
1 parent 3358ba7 commit 0cec5a0
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/components/TreeView/TreeView.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,6 @@ const TreeView = ({
children = await node.getChildren();
setLoading(null);
}

// set parent relation for all children
children.forEach((child) => (child.parentId = node.id));

Expand Down Expand Up @@ -288,7 +287,10 @@ const TreeView = ({
hasChildren={node.getChildren ? true : false}
isExpanded={node.isExpanded === true}
isVoided={node.isVoided === true}
isSelected={node.id.toString().includes(selectedLibraryItem)}
isSelected={
!!selectedLibraryItem &&
node.id.toString().includes(selectedLibraryItem)
}
title={node.name}
>
{node.onClick ? (
Expand Down

0 comments on commit 0cec5a0

Please sign in to comment.