fix: #10951 修复 InputTable 在 配置 perPage 开启分页场景时,底部新增按钮展示异常

This commit is contained in:
Jeremy Pang 2024-09-25 23:37:46 +08:00
parent d19c7af137
commit cd21ac6250

View File

@ -1941,6 +1941,13 @@ export default class FormTable extends React.Component<TableProps, TableState> {
offset = (page - 1) * perPage;
}
// 底部新增按钮是否显示
const footerAddBtnVisible =
!isStatic &&
addable &&
showFooterAddBtn !== false &&
(!maxLength || maxLength > this.state.items.length);
return (
<div className={cx('InputTable', className)}>
{render(
@ -1983,13 +1990,9 @@ export default class FormTable extends React.Component<TableProps, TableState> {
testIdBuilder: testIdBuilder?.getChild('table')
}
)}
{(!isStatic &&
addable &&
showFooterAddBtn !== false &&
(!maxLength || maxLength > items.length)) ||
showPager ? (
{footerAddBtnVisible || showPager ? (
<div className={cx('InputTable-toolbar', toolbarClassName)}>
{addable && showFooterAddBtn !== false
{footerAddBtnVisible
? render(
'button',
{