Skip to content

Commit

Permalink
fix(treeview): prevent node selection on toggle (#15354)
Browse files Browse the repository at this point in the history
  • Loading branch information
janhassel authored Dec 19, 2023
1 parent a0fd477 commit 0fc1ef6
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions packages/react/src/components/TreeView/TreeNode.js
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,10 @@ const TreeNode = React.forwardRef(
if (disabled) {
return;
}

// Prevent the node from being selected
event.stopPropagation();

onToggle?.(event, { id, isExpanded: !expanded, label, value });
setExpanded(!expanded);
}
Expand Down

0 comments on commit 0fc1ef6

Please sign in to comment.