Skip to content

Commit

Permalink
fix(treeselect): fix keys not pass pass through to default tree store (
Browse files Browse the repository at this point in the history
  • Loading branch information
ZWkang authored May 14, 2024
1 parent c49f7b2 commit 64000fb
Showing 1 changed file with 13 additions and 1 deletion.
14 changes: 13 additions & 1 deletion src/tree-select/TreeSelect.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,19 @@ const TreeSelect = forwardRef<TreeSelectRefType, TreeSelectProps>((originalProps
[props.keys],
);

const { normalizeValue, formatValue, getNodeItem } = useTreeSelectUtils(props, treeRef);
const passThroughDefaultStore = useMemo<TreeSelectProps>(
() => ({
data,
treeProps: {
keys: tKeys,
...treeProps,
},
valueType,
}),
[tKeys, data, treeProps, valueType],
);

const { normalizeValue, formatValue, getNodeItem } = useTreeSelectUtils(passThroughDefaultStore, treeRef);

useImperativeHandle(ref, () => ({
...(selectInputRef.current || {}),
Expand Down

0 comments on commit 64000fb

Please sign in to comment.