Skip to content

Commit

Permalink
fix: tree-select selectable not work, close #4838
Browse files Browse the repository at this point in the history
  • Loading branch information
tangjinzhou committed Nov 2, 2021
1 parent 6f0dab1 commit 35bcec1
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
3 changes: 2 additions & 1 deletion components/vc-tree-select/hooks/useTreeData.ts
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ function formatTreeData(

function dig(dataNodes: DataNode[]) {
return (dataNodes || []).map(node => {
const { key, disableCheckbox, disabled } = node;
const { key, disableCheckbox, disabled, selectable } = node;

const value = node[fieldValue];
const mergedValue = fieldValue in node ? value : key;
Expand All @@ -76,6 +76,7 @@ function formatTreeData(
value: mergedValue,
title: getLabelProp(node),
node,
selectable,
dataRef: node,
};

Expand Down
6 changes: 4 additions & 2 deletions components/vc-tree-select/interface.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ export interface DataNode {
disableCheckbox?: boolean;
checkable?: boolean;
children?: DataNode[];
selectable?: boolean;

/** Customize data info */
[prop: string]: any;
Expand All @@ -32,8 +33,9 @@ export interface InternalDataEntity {
key: Key;
value: RawValueType;
title?: any;
disableCheckbox?: boolean;
disabled?: boolean;
disableCheckbox: boolean;
disabled: boolean;
selectable: boolean;
children?: InternalDataEntity[];

/** Origin DataNode */
Expand Down

0 comments on commit 35bcec1

Please sign in to comment.