Skip to content

Commit

Permalink
fix(treeview): don't overwrite disabled=true state for children (#16079)
Browse files Browse the repository at this point in the history
  • Loading branch information
janhassel committed Apr 3, 2024
1 parent f28b9ab commit 53be4cb
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 1 deletion.
2 changes: 1 addition & 1 deletion packages/react/src/components/TreeView/TreeNode.js
Expand Up @@ -62,7 +62,7 @@ const TreeNode = React.forwardRef(
return React.cloneElement(node, {
active,
depth: depth + 1,
disabled,
disabled: disabled || node.props.disabled,
onTreeSelect,
selected,
tabIndex: (!node.props.disabled && -1) || null,
Expand Down
9 changes: 9 additions & 0 deletions packages/react/src/components/TreeView/Treeview.stories.js
Expand Up @@ -262,3 +262,12 @@ Playground.argTypes = {
control: { type: 'select' },
},
};

export const Temp = () => (
<TreeView label="Tree View">
<TreeNode label="Enabled">
<TreeNode label="Disabled" disabled />
</TreeNode>
<TreeNode label="Disabled" disabled></TreeNode>
</TreeView>
);

0 comments on commit 53be4cb

Please sign in to comment.