Skip to content

Commit

Permalink
fix: adds additional check / set for active group (#4037)
Browse files Browse the repository at this point in the history
set active group
  • Loading branch information
timarney authored Jul 19, 2024
1 parent 3b43dc0 commit a783644
Showing 1 changed file with 7 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -316,7 +316,13 @@ const ControlledTree: ForwardRefRenderFunction<unknown, TreeDataProviderProps> =

setId(item.isFolder ? String(item.index) : String(parent?.index));
}}
onExpandItem={(item) => setExpandedItems([...expandedItems, item.index])}
onExpandItem={(item) => {
if (item.index !== groupId) {
setId(String(item.index));
}

setExpandedItems([...expandedItems, item.index]);
}}
onCollapseItem={(item) =>
setExpandedItems(
expandedItems.filter((expandedItemIndex) => expandedItemIndex !== item.index)
Expand Down

0 comments on commit a783644

Please sign in to comment.