Skip to content

Commit

Permalink
fix: Transfer render Empty when customize without data (ant-design#16925
Browse files Browse the repository at this point in the history
)
  • Loading branch information
zombieJ authored Jun 3, 2019
1 parent 8b1985b commit 10fec94
Showing 1 changed file with 16 additions and 17 deletions.
33 changes: 16 additions & 17 deletions components/transfer/list.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -159,26 +159,25 @@ export default class TransferList extends React.Component<TransferListProps, Tra
</div>
) : null;

const searchNotFound = !filteredItems.length && (
<div className={`${prefixCls}-body-not-found`}>{notFoundContent}</div>
);

let listBody: React.ReactNode = bodyDom;
if (!listBody) {
let bodyNode: React.ReactNode = searchNotFound;
if (!bodyNode) {
const { bodyContent, customize } = renderListNode(renderList, {
...omit(this.props, OmitProps),
filteredItems,
filteredRenderItems,
selectedKeys: checkedKeys,
});

// We should wrap customize list body in a classNamed div to use flex layout.
bodyNode = customize ? (
<div className={`${prefixCls}-body-customize-wrapper`}>{bodyContent}</div>
) : (
let bodyNode: React.ReactNode;

const { bodyContent, customize } = renderListNode(renderList, {
...omit(this.props, OmitProps),
filteredItems,
filteredRenderItems,
selectedKeys: checkedKeys,
});

// We should wrap customize list body in a classNamed div to use flex layout.
if (customize) {
bodyNode = <div className={`${prefixCls}-body-customize-wrapper`}>{bodyContent}</div>;
} else {
bodyNode = filteredItems.length ? (
bodyContent
) : (
<div className={`${prefixCls}-body-not-found`}>{notFoundContent}</div>
);
}

Expand Down

0 comments on commit 10fec94

Please sign in to comment.