Skip to content

Commit

Permalink
fix(cascader): fix cascader item disabled pass down
Browse files Browse the repository at this point in the history
  • Loading branch information
berber1016 committed Dec 9, 2021
1 parent 21b4cf3 commit a47f0d5
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions src/list/inner/CascaderItem.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,9 @@ const CascaderItem: React.ForwardRefRenderFunction<
/** options render */
if (!isEmpty(childrens)) {
return (
<ListContext.Provider value={{ ...context, model: 'cascader', selectParent: childSelectPrent }}>
<ListContext.Provider
value={{ ...context, disabled: mergedDisabled, model: 'cascader', selectParent: childSelectPrent }}
>
<List>
{childrens?.map((child) => (
<CascaderItem
Expand All @@ -59,9 +61,12 @@ const CascaderItem: React.ForwardRefRenderFunction<
</ListContext.Provider>
);
}

/** JSX */
return (
<ListContext.Provider value={{ ...context, model: 'cascader', selectParent: childSelectPrent }}>
<ListContext.Provider
value={{ ...context, disabled: mergedDisabled, model: 'cascader', selectParent: childSelectPrent }}
>
{children}
</ListContext.Provider>
);
Expand Down

0 comments on commit a47f0d5

Please sign in to comment.