mirror of
https://github.com/ant-design/ant-design.git
synced 2024-11-28 13:09:40 +08:00
fix: Transfer render Empty when customize without data (#16925)
This commit is contained in:
parent
8b1985bc9b
commit
10fec945e5
@ -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,
|
||||
});
|
||||
let bodyNode: React.ReactNode;
|
||||
|
||||
// We should wrap customize list body in a classNamed div to use flex layout.
|
||||
bodyNode = customize ? (
|
||||
<div className={`${prefixCls}-body-customize-wrapper`}>{bodyContent}</div>
|
||||
) : (
|
||||
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>
|
||||
);
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user