Skip to content

Commit

Permalink
fix(list): fix list collapse style error (#1719)
Browse files Browse the repository at this point in the history
  • Loading branch information
berber1016 committed Dec 22, 2021
1 parent 51f57f7 commit 3369329
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/list/List.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ import useValue from './hooks/useValue';
import useCacheOptions from './hooks/useCacheOptions';
import defaultLocaleTextObject from './locales/zh-CN';
import Empty from './Empty';
import BaseItem from './inner/baseItem';

export const InnerList = WithRef<HTMLDivElement, ListProps>((props, ref?) => {
const {
Expand Down Expand Up @@ -154,13 +155,13 @@ export const InnerList = WithRef<HTMLDivElement, ListProps>((props, ref?) => {
const renderExpandedItem = (needCollapse = false) => {
if (needCollapse) {
return (
<Item
<BaseItem
data-testid="list-item-collapse"
disabled={mergedDisabled}
key={`${prefixCls}-collapse`}
value={`${prefixCls}-collapse`}
onClick={() => setCollapse(Infinity)}
label={localeTextObject?.expandAll(renderOptions?.length ?? 0)}
label={localeTextObject?.expandAll(renderOptions?.length - collapse ?? 0)}
/>
);
}
Expand Down

1 comment on commit 3369329

@vercel
Copy link

@vercel vercel bot commented on 3369329 Dec 22, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.