Skip to content

Commit

Permalink
feat(TreeView): Fixing onSelectedItemChange (#1226)
Browse files Browse the repository at this point in the history
  • Loading branch information
silvalaura committed Sep 18, 2024
1 parent 47087f1 commit 492f83e
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -167,7 +167,7 @@ export const Complex = args => {
label={<>Chapter 1: I love tiramisu jelly beans soufflé</>}
itemId="pt1ch1"
testId="pt1ch1"
isDisabled
// isDisabled
>
<TreeItem
icon={<ArticleIcon aria-hidden={true} />}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -532,7 +532,6 @@ export function useTreeItem(props: UseTreeItemProps, forwardedRef) {
) {
setStatusUpdatedBy(StatusUpdatedByOptions.children);
setCheckedStatus(statusFromChildren);

if (
statusFromChildren === IndeterminateCheckboxStatus.checked ||
statusFromChildren === IndeterminateCheckboxStatus.indeterminate
Expand Down Expand Up @@ -614,7 +613,7 @@ export function useTreeItem(props: UseTreeItemProps, forwardedRef) {
Array(numberOfTreeItemChildren).fill(status)
);
} else {
const childrenIds = getChildrenItemIds(treeItemChildren, 'something');
const childrenIds = getChildrenItemIds(treeItemChildren);

const newChildrenCheckedStatus = getChildrenCheckedStatus(
childrenIds,
Expand Down Expand Up @@ -673,7 +672,6 @@ export function useTreeItem(props: UseTreeItemProps, forwardedRef) {
childrenIds,
{ itemId, checkedStatus }
);

setSelectedItems(newSelectedItems);
updateSelectedItemsChanged();
}
Expand Down

0 comments on commit 492f83e

Please sign in to comment.