Skip to content

Commit

Permalink
fix(module:table): data is not updated when pagination exists
Browse files Browse the repository at this point in the history
  • Loading branch information
hsuanxyz committed Dec 31, 2020
1 parent a9a6bee commit 0b7cc72
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
3 changes: 2 additions & 1 deletion components/table/src/table/table.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,8 @@ const NZ_CONFIG_MODULE_NAME: NzConfigKey = 'table';
</nz-spin>
<ng-template #paginationTemplate>
<nz-pagination
*ngIf="nzShowPagination && showPagination && data.length"
*ngIf="nzShowPagination && data.length"
[hidden]="!showPagination"
class="ant-table-pagination ant-table-pagination-right"
[nzShowSizeChanger]="nzShowSizeChanger"
[nzPageSizeOptions]="nzPageSizeOptions"
Expand Down
2 changes: 1 addition & 1 deletion components/table/src/testing/table.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -207,7 +207,7 @@ describe('nz-table', () => {
testComponent.hideOnSinglePage = true;
testComponent.dataSet = [{}];
fixture.detectChanges();
expect(table.nativeElement.querySelector('.ant-pagination')).toBeNull();
expect(table.nativeElement.querySelector('.ant-pagination[hidden]')).not.toBeNull();
});
it('should showPagination work with nzFrontPagination and hideOnSinglePage', () => {
fixture.detectChanges();
Expand Down

0 comments on commit 0b7cc72

Please sign in to comment.