Skip to content

Commit

Permalink
fix(list): fix context interfance
Browse files Browse the repository at this point in the history
  • Loading branch information
berber1016 committed Dec 22, 2021
1 parent ddbbc3e commit e005361
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/list/List.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ export const InnerList = WithRef<HTMLDivElement, ListProps>((props, ref?) => {
onClick,
itemStrategy,
empty,
max,
needEmpty = false,
...listRestProps
} = props;
Expand All @@ -58,6 +59,7 @@ export const InnerList = WithRef<HTMLDivElement, ListProps>((props, ref?) => {
const mergedEmpty = empty ?? context.emptyNode;
const mergedIsEmpty = needEmpty || context.isEmpty;
const mergedDisabled = disabled ?? contextDisabled;
const mergedMax = max ?? context.max;
/** end */

const { value, onChange } = useValue(
Expand Down Expand Up @@ -178,6 +180,7 @@ export const InnerList = WithRef<HTMLDivElement, ListProps>((props, ref?) => {
<ListContext.Provider
value={{
...context,
max: mergedMax,
model: mergedModel,
isEmpty: mergedIsEmpty,
emptyNode: mergedEmpty,
Expand Down

0 comments on commit e005361

Please sign in to comment.