Merge pull request #10967 from jinmingpang/fix-issue-10951

fix: #10951 修复 InputTable 在 配置 perPage 开启分页场景时,底部新增按钮展示异常
This commit is contained in:
hsm-lv 2024-10-08 20:35:16 +08:00 committed by GitHub
commit a751ede14e
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

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',
{